import type { Cell, GameSettings, GameState, Move } from "../types.ts"; /** * ROCKFALL: the rocks that land partway through a game. * * A rock game whose spec says `arriveAfter` starts on an open board, and once * that many stones have been played its rocks and hotspots fall onto every * point still empty. It happens inside the move that plays that stone, so a * replay of the record lands them at the same moment, from the same seed, and * the engine stays the only thing that decides what is on the board. * * Two things can never happen, and each is the choice that leaves the game to * the players: * * - A rock or hotspot never lands on a stone. It is lost, and the stone stays * (`landRocks`). * - A hotspot never lands where it would finish a line by itself. A hotspot * counts for both colours, so one falling into the gap of a four would hand * somebody the game for a move nobody made. It is lost too. */ /** Stones played so far: every move that put one down, and nothing that did not. */ export declare function stonesPlayed(moves: readonly Move[]): number; /** * The state with its rocks fallen, when the move just played is the one they * fall after and the game is still going; otherwise the state it was given. * A move that has already won is not followed by a fall. */ export declare function fallRocks(state: GameState): GameState; /** * The board with the fallen rocks lifted again, for undoing the move they fell * after; otherwise the board it was given. `moves` is the record as it stood * WITH that move, so the question is the same one `fallRocks` asked. A point * is cleared only where the layout put something the empty board does not * have, so a star point's block, or a rock that never fell, is left alone. */ export declare function liftFallenRocks(board: Cell[], settings: GameSettings, moves: readonly Move[]): Cell[];