Created
March 29, 2020 14:00
-
-
Save ikovalyov/23254363132d9785610c72e5afff1f1a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun turnOnTheTeaPot(teapotService: TeaPotService) : Boolean { | |
teaPotService.turnOn() | |
return true | |
} | |
fun turnOffTheTeaPot(teapotService: TeaPotService) : Boolean { | |
teaPotService.turnOff() | |
return false | |
} | |
fun main() { | |
val turnOnTheTeaPot = true | |
val teaPotService = TeaPotService() | |
val teaPotTurnedOn = if (turnOnTheTeaPot) { | |
turnOnTheTeaPot(teaPotService) | |
} else { | |
turnOffTheTeaPot(teaPotService) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment