longestPossibleGamefunction
The most moves a game of these settings can contain, or null when nothing in the rules bounds it.
Read from the spec rather than from a list of variant names, so a game added tomorrow is classified the day it lands.
Import it
import { longestPossibleGame } from "@johnmorrisdotca/narabe";
Definition
function longestPossibleGame(settings: GameSettings): number | null
Parameters
| Name | Type | Description |
|---|---|---|
settings | GameSettings | The native game settings to interpret. |
Returns
number | null
The board-based maximum move count, or null when captures, clearing or moving pieces remove that bound.
Examples
import { createGame, longestPossibleGame } from "@johnmorrisdotca/narabe";
const state = createGame({variant:"freestyle",size:15});
console.log(longestPossibleGame(state.settings));225What it prints (run when this page was built)