Skip to content

Instantly share code, notes, and snippets.

@waterlink
Created October 15, 2018 15:47
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 waterlink/d264b3d269268037c5c2ba3f15af0900 to your computer and use it in GitHub Desktop.
Save waterlink/d264b3d269268037c5c2ba3f15af0900 to your computer and use it in GitHub Desktop.
step - 6
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