import type { Cell, GameSettings, GameState, HeadStart, Move, Point, Stone, TraditionalHeadStart } from "../types.ts"; /** The komi of a Go game played with handicap stones: half a point, so it still cannot tie. */ export declare const HEAD_START_KOMI = 0.5; /** * The head start a settings object carries, or none. A game stored or kept in * a browser before head starts existed has no field at all, and that game was * an even one — so absent reads as none, never as a start nobody gave. */ export declare function headStartOf(settings: { headStart?: HeadStart | null; }): HeadStart; /** Whether anybody has been given a start at all. */ export declare function hasHeadStart(settings: { headStart?: HeadStart | null; }): boolean; /** The kind of traditional head start a game has, or null for a game with none (or one this deploy does not know). */ export declare function traditionalKind(variant: string): TraditionalHeadStart | null; /** * How much of its traditional head start a game on this board may give, as the * choices to offer. Empty where it has none. * * Go counts the star points the board is drawn with: two to nine on 19×19, two * to five on the smaller boards, which mark only their corners and centre. A * single stone is not offered — Go's "one-stone handicap" is taking Black with * no komi, which is not a stone on the board at all. */ export declare function traditionalCounts(variant: string, size: number): readonly number[]; /** * The free turns a game offers: one up to its declared `headStartTurns`, and * none where it declares none — the flipping games, where a single free turn * takes the other side's last disc, and the small boards a free turn wins. */ export declare function freeTurnsOffered(variant: string): readonly number[]; /** * A head start that agrees with its game and board: free turns among those the * game offers, a traditional part the game has at this size, and no colour at * all where nothing is left. Anything it cannot read comes out as less, never * as more — the safe direction for a start somebody may not have agreed to. So * free turns above the game's own most are refused, whether they arrive from a * stale address, a request or a stored row: a head start that could decide the * game is not given at all. */ export declare function normaliseHeadStart(settings: { variant: string; size: number; headStart?: HeadStart | null; }): HeadStart; /** * The colour that must open because of a head start, or null where the head * start says nothing about it. Only handicap stones do: they ARE the given * colour's opening moves, so the other colour plays next — White first in an * ordinary handicap game. */ export declare function headStartOpener(settings: { variant: string; size: number; headStart?: HeadStart | null; }): Stone | null; /** The komi a Go game is counted with: the usual, or half a point where handicap stones were given. */ export declare function komiFor(settings: { variant: string; size: number; headStart?: HeadStart | null; }): number; /** * Where handicap stones go, in the order they are given: the far corners from * Black's side first (upper right, lower left), then the other two, then the * centre on an odd count, then the side points. The customary placement. */ export declare function handicapStonePoints(size: number, count: number): Point[]; /** The corners an Othello head start gives, in order: a1, h8, h1, a8. */ export declare function cornerPoints(size: number, count: number): Point[]; /** The pieces a head start sets out before anybody moves: handicap stones or corners. */ export declare function headStartPieces(settings: GameSettings): { point: Point; stone: Stone; }[]; /** * The men draughts odds take off the stronger side: from its own back row, * starting at its left as that player sits — Black sits at the top of the * board, so its left is the right-hand end of row 0; White's is the left-hand * end of the bottom row. Read off the board as it was set out, so only men that * are there are taken. */ export declare function headStartOdds(settings: GameSettings, board: readonly Cell[]): Point[]; /** Head-start turns given so far: the passes the record says a head start took. */ export declare function headStartTurnsGiven(moves: readonly Move[]): number; /** * Whether the colour to move owes the other a free turn: its turn is one of * the head start's, and passes on the record. * * True just after the colour given the start has finished a turn of its own — * a stone, a move, a piece, a twist — while turns remain and the start is not * spent. Not after a pass or a turn lost on time: a turn with nothing in it is * not a turn the head start gave. Cheap when nobody has a start, which is * nearly every game, because `isLegalMove` asks it of every point. */ export declare function owesHeadStart(state: GameState): boolean; /** * The head-start turn the latest move gave, as the boards announce it: whose * start it is, which of its free turns this was, and how many there are. Null * where the latest move is anything else — so the notice is there for exactly * the moment the turn came back, and gone with the next move. */ export declare function headStartTurnTaken(state: GameState): { stone: Stone; turn: number; of: number; } | null;