Created
October 15, 2018 15:45
-
-
Save waterlink/a1b4b0113a6b42816f87d4911440802c to your computer and use it in GitHub Desktop.
step - 4
This file contains 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
interface Throw { | |
fun beats(other: Throw): Boolean | |
object SCISSORS : Throw { | |
override fun beats(other: Throw) = other != ROCK | |
} | |
object PAPER : Throw { | |
override fun beats(other: Throw) = other != SCISSORS | |
} | |
object ROCK : Throw { | |
override fun beats(other: Throw) = other != PAPER | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment