import type { Cell, GameSettings, Point, Stone } from "../types.ts"; /** * The race games: every piece starts in a camp in one corner and the object * is to get them all into the far corner first. Nothing is captured and no * line means anything; a piece steps to a neighbouring square, or jumps over * any piece — either colour — into the empty square beyond, and may go on * jumping in one move as long as there is something to jump. */ /** * The camp on each board, as rows counted from the corner: how many squares * of each row belong to it. Halma's 16×16 camp is nineteen pieces; the * smaller boards take the camps the game is played with on them. */ export declare const CAMP_ROWS: Record; /** Pieces a side has on `size`: the squares of its camp. * * @param size - The number of cells on each side of the board. * @returns Pieces a side has on `size`: the squares of its camp. * @example * ```ts * import { campSize } from "@johnmorrisdotca/narabe"; * * console.log(campSize(8)); * ``` */ export declare function campSize(size: number): number; /** * The squares of a colour's home camp. Black starts top-left and white * bottom-right, each camp the mirror of the other through the centre. * * @param size - The number of cells on each side of the board. * @param stone - The black or white colour being examined. * @returns The squares of a colour's home camp. Black starts top-left and white bottom-right, each camp the mirror of the other through the centre. * @example * ```ts * import { campSquares } from "@johnmorrisdotca/narabe"; * * console.log(campSquares(8,"black")); * ``` */ export declare function campSquares(size: number, stone: Stone): Point[]; /** Whose home camp `point` lies in, or null for the open board. * * @param size - The number of cells on each side of the board. * @param point - A zero-based row and column on the board. * @returns The starting camp colour, or null outside both camps. * @example * ```ts * import { campOf } from "@johnmorrisdotca/narabe"; * * console.log(campOf(8,{row:0,col:0})); * ``` */ export declare function campOf(size: number, point: Point): Stone | null; /** Every piece on the board when the game starts: each colour filling its own camp. */ export declare function startingPieces(settings: GameSettings): { point: Point; stone: Stone; }[]; /** * Where a piece at `from` may go: any empty neighbouring square, or the end * of any chain of jumps. A jump crosses one adjacent piece of either colour * into the empty square straight beyond it, and a chain may turn corners * but never revisits a square, so it always ends. */ export declare function campMoves(board: Cell[], size: number, from: Point): Point[]; /** * Whether `stone` has won: the far camp — the other colour's home — is full, * and at least one piece in it is theirs. Filling it with your own pieces is * the ordinary way; the rule also covers a side that leaves pieces at home * to block, which cannot save them once every other square is taken. */ export declare function campFilled(board: Cell[], size: number, stone: Stone): boolean; /** How many of `stone`'s pieces stand in the far camp. * * @param board - The row-major board cells; null marks an empty point. * @param size - The number of cells on each side of the board. * @param stone - The black or white colour being examined. * @returns How many of `stone`'s pieces stand in the far camp. * @example * ```ts * import { createGame, piecesHome } from "@johnmorrisdotca/narabe"; * * const halma = createGame({variant:"halma",size:8}); * console.log(piecesHome(halma.board,8,"black")); * ``` */ export declare function piecesHome(board: Cell[], size: number, stone: Stone): number;