https://kotlinlang.org logo
#getting-started
Title
# getting-started
e

Everett Corvid

11/16/2023, 12:25 AM
As a now second day kotlin learner, I'm really loving this syntax and no C gurus yelling at me that you cant add ++ definitions to class enums
fun makeComChoice(): Int = (1..3).random()
if (input == -1 || input in 1..3) isValid = true
else throw NumberFormatException()
return if ((comChoice + 1) % 3 == playerChoice) 0
else if (comChoice == playerChoice) 1
else 2
when (winTieLoss) {
0 -> {
score++
println("You win!")
}
1 -> println("It's a tie.")
2 -> {
score--
println("You lose, oh no!")
}
}
K 2