Skip to content

Instantly share code, notes, and snippets.

@AlexPinhasov
Last active April 7, 2018 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexPinhasov/ad750d7cdd1591f533d4becdf60eac0f to your computer and use it in GitHub Desktop.
Save AlexPinhasov/ad750d7cdd1591f533d4becdf60eac0f to your computer and use it in GitHub Desktop.
// Router Function
private func turnLights(on shouldTurnLightsOn: Bool)
{
if shouldTurnLightsOn
{
turnExteriorLightsOn()
checkForBurnedBulbs()
}
else { turnExteriorLightsOff() }
// When an if statment has only 1 thing to execute i like to write it
// at the same line with the "if" "else" word, it makes reading your code more fluent.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment