Reference · Rules, games and records
onBoardfunction
How many checkers side has on the board's points, not counting the bar, the reserve and those borne off.
Import it
import { onBoard } from "@johnmorrisdotca/sugoroku";
Definition
function onBoard(position: Position, side: Side): number
Parameters
| Name | Type | Description |
|---|---|---|
position | Position | The native checker counts, bar, reserve and borne-off counts. |
side | Side | The side being examined: white or black. |
Returns
number
How many checkers side has on the board's points, not counting the bar, the reserve and those borne off.
Examples
import { onBoard, settingsFor, startPosition } from "@johnmorrisdotca/sugoroku";
const settings = settingsFor("backgammon",{points:5,cube:true});
const spec = settings.variant;
const position = startPosition(spec);
console.log(onBoard(position,"white"));15What it prints (run when this page was built)