How do you type maps properly in Kotlin? I want to make a type that is a map with two required keys. tried using class, but I am at a loss.
Copy code
abstract class GameState(i: Int, i1: Int) {
abstract val pinsLeft: Int
abstract val triesLeft: Int
}
fun roll(pinsDown: Int,
pinsLeft: Int = 10,
triesLeft: Int = 2): GameState {
return mapOf(Pair("pinsLeft", pinsLeft - pinsDown), Pair("triesLeft", --triesLeft)
}