Board

class Board

Immutable board snapshot.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val size: Int

Functions

Link copied to clipboard
fun encode(): String

Compact serialised form, e.g. "XO.X.O..." — used for history thumbnails.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
operator fun get(index: Int): Mark?
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Whether the game has ended in a draw: full board, or no line can still be won by anyone.

Link copied to clipboard
fun play(index: Int, mark: Mark): Board
Link copied to clipboard
fun threats(mark: Mark): Set<Int>

Empty cells that would immediately complete a line for mark.

Link copied to clipboard
fun toList(): List<Mark?>
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun winner(): WinLine?