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