Skip to content

Instantly share code, notes, and snippets.

@waterlink
Created October 15, 2018 15:44
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/d95644a21bd27835f0ac8cd595568746 to your computer and use it in GitHub Desktop.
Save waterlink/d95644a21bd27835f0ac8cd595568746 to your computer and use it in GitHub Desktop.
step - 3
enum class Throw {
SCISSORS, PAPER, ROCK;
fun beats(other: Throw) =
this == SCISSORS && other != ROCK ||
this == PAPER && other != SCISSORS ||
this == ROCK && other != PAPER
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment