skipTargetfunction
Where a skipped turn puts its stone: the open intersection furthest from the
action, picked from the corner chosen by roll. A skip is still a stone on
the board — it just spends the turn somewhere that should not matter.
Import it
import { skipTarget } from "@johnmorrisdotca/narabe";
Definition
function skipTarget(state: GameState, roll?: number): Point | null
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
Point | null
The chosen empty point, or null when no point is available.
Examples
import { createGame, skipTarget } from "@johnmorrisdotca/narabe";
console.log(skipTarget(createGame({allowSkip:true}), 0.5));{ row: 14, col: 0 }What it prints (run when this page was built)