Reference · Rules, games and records
checkersOffunction
The whole count of each side's checkers: on the board, on the bar, yet to enter, and off. Always the variant's checkers.
Import it
import { checkersOf } from "@johnmorrisdotca/sugoroku";
Definition
function checkersOf(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
The whole count of each side's checkers: on the board, on the bar, yet to enter, and off. Always the variant's checkers.
Examples
import { checkersOf, settingsFor, startPosition } from "@johnmorrisdotca/sugoroku";
const settings = settingsFor("backgammon",{points:5,cube:true});
const spec = settings.variant;
const position = startPosition(spec);
console.log(checkersOf(position,"white"));15What it prints (run when this page was built)