replayGamefunction
The position as it stands now.
Import it
import { replayGame } from "@johnmorrisdotca/narabe";
Definition
function replayGame(game: StoredGame): GameState
Parameters
| Name | Type | Description |
|---|---|---|
game | StoredGame | The saved settings and move record to rebuild. |
Returns
GameState
The resulting position; a refused or inapplicable action leaves the input position unchanged.
Examples
import { replayGame } from "@johnmorrisdotca/narabe";
const stored = {size:15,winLength:5,variant:"freestyle",obstacles:"none",opener:"black",moveTimeMs:null,moves:[{row:7,col:7}]};
console.log(replayGame(stored).moves.length);1What it prints (run when this page was built)