movesBeforeDrawfunction
How many moves may be played before a game nobody has won is a draw, or null when it is to be played out.
Rounded down, so "half the board" on an odd board is the smaller half: a limit that arrives a move early is easier to defend than one that arrives a move late.
Import it
import { movesBeforeDraw } from "@johnmorrisdotca/narabe";
Definition
function movesBeforeDraw(settings: GameSettings): number | null
Parameters
| Name | Type | Description |
|---|---|---|
settings | GameSettings | The native game settings to interpret. |
Returns
number | null
The configured move limit, or null when the settings have no applicable length limit.
Examples
import { createGame, movesBeforeDraw } from "@johnmorrisdotca/narabe";
const state = createGame({variant:"freestyle",size:15});
console.log(movesBeforeDraw(state.settings));nullWhat it prints (run when this page was built)