skipMovefunction
Burns the turn on a corner stone. A no-op when skipping is not allowed.
Import it
import { skipMove } from "@johnmorrisdotca/narabe";
Definition
function skipMove(state: GameState, roll?: number): GameState
Parameters
| Name | Type | Description |
|---|---|---|
state | GameState | The current immutable game position. |
roll (optional) | number | A random value in [0,1), supplied for reproducible choices. |
Returns
GameState
The resulting position; a refused or inapplicable action leaves the input position unchanged.
Examples
import { createGame, skipMove } from "@johnmorrisdotca/narabe";
console.log(skipMove(createGame({allowSkip:true}), 0.5).moves.length);1What it prints (run when this page was built)