Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun getChoice(input: String?) = when(input) {
- Choices.ROCK.id -> Choices.ROCK.name()
- Choices.PAPER.id -> Choices.PAPER.name()
- Choices.SCISSORS.id -> Choices.SCISSORS.name()
- else -> "BAD CHOICE"
- }
- fun main() {
- val player = Player()
- var input: String
- print("Enter your choice: ")
- input = readline()!!
- player.choice = getChoice(input)
- println(player.choice)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement