Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private fun computeGameResult(myMove: GameOption, opponentMove: GameOption): GameResult {
- if (myMove == opponentMove) return GameResult.TIE
- return when (myMove) {
- ROCK -> if (opponentMove == SCISSORS) return WIN else LOSE
- PAPER -> if (opponentMove == ROCK) return WIN else LOSE
- SCISSORS -> if (opponentMove == PAPER) return WIN else LOSE
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement