Skip to content

Instantly share code, notes, and snippets.

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