Skip to content

Instantly share code, notes, and snippets.

@waterlink
Created October 15, 2018 15:42
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/c418cb1df37a988c6aeb072128527bc1 to your computer and use it in GitHub Desktop.
Save waterlink/c418cb1df37a988c6aeb072128527bc1 to your computer and use it in GitHub Desktop.
step - 1
fun play(first: Throw, second: Throw): Winner {
if (first == second) {
return TIE
}
if (first == SCISSORS && second != ROCK ||
first == PAPER && second != SCISSORS ||
first == ROCK && second != PAPER) {
return FIRST_PLAYER
}
return SECOND_PLAYER
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment