Skip to content

Instantly share code, notes, and snippets.

@waterlink
Created October 15, 2018 16:03
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/e2eaea3994806fa081125153e294f27d to your computer and use it in GitHub Desktop.
Save waterlink/e2eaea3994806fa081125153e294f27d to your computer and use it in GitHub Desktop.
step - 15
return when (first to second) {
// classic rules
SCISSORS to PAPER,
PAPER to ROCK,
ROCK to SCISSORS -> FIRST_PLAYER
// additional modern rules
ROCK to LIZARD,
LIZARD to SPOCK,
SPOCK to SCISSORS,
SCISSORS to LIZARD,
LIZARD to PAPER,
PAPER to SPOCK,
SPOCK to ROCK -> FIRST_PLAYER
else -> SECOND_PLAYER
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment