Ludo

object Ludo

Functions

Link copied to clipboard
fun apply(state: LudoState, action: LudoAction, random: Random = Random.Default): LudoState?

Applies action if it's legal right now; returns null (and changes nothing) otherwise.

Link copied to clipboard

"Match me" — pick the rival furthest ahead, so duels keep the leader honest.

Link copied to clipboard
fun legalPawns(s: LudoState, color: LudoColor, die: Int): List<Int>
Link copied to clipboard
fun newGame(seats: List<LudoSeat>, difficulty: Difficulty, random: Random = Random.Default): LudoState
Link copied to clipboard
fun target(progress: Int, die: Int): Int?

Where a pawn at progress lands with die, or null if it can't move.