LudoBoard

object LudoBoard

Properties

Link copied to clipboard
const val GRID: Int = 15
Link copied to clipboard
const val HOME: Int = 56
Link copied to clipboard
const val LAST_LOOP: Int = 50
Link copied to clipboard
const val LOOP: Int = 52
Link copied to clipboard
val loop: List<Pair<Int, Int>>

The 52-square loop as (column, row) on a 15×15 grid, clockwise from the left arm.

Link copied to clipboard
const val PAWNS: Int = 4
Link copied to clipboard
val safe: Set<Int>

Squares where nobody can be captured: every start, and the square eight on from each start.

Functions

Link copied to clipboard
fun cellOf(color: LudoColor, progress: Int): Pair<Int, Int>?

Grid cell for a pawn, or null while it's in base or home.

Link copied to clipboard
fun lane(color: LudoColor): List<Pair<Int, Int>>

Each colour's five home-lane squares, outside in.

Link copied to clipboard
fun loopIndex(color: LudoColor, progress: Int): Int