Fix me

Report a typo

This code contains an error. Find it and fix the problem!

Note: the error can be fixed in more than one way.

Write a program in Kotlin
class Player(val id: Int, name: String) {
companion object {
val defaultSpeed = 8
val maxSpeed = 13

fun calcMovePenalty(cell: Int): Int {
return defaultSpeed - cell % 3
}
}
}

fun calculatePlayerSpeed(cell: Int): Int {
return Player.Properties.calcMovePenalty(cell)
}
___

Create a free account to access the full topic