Created
October 15, 2018 15:42
-
-
Save waterlink/c418cb1df37a988c6aeb072128527bc1 to your computer and use it in GitHub Desktop.
step - 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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