Reference · Rules, games and records
countAtfunction
How many of side's checkers stand on its own point own (1 to 24).
Import it
import { countAt } from "@johnmorrisdotca/sugoroku";
Definition
function countAt(position: Position, side: Side, own: number): 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. |
own | number | A point in this side’s own numbering. |
Returns
number
How many of side's checkers stand on its own point own (1 to 24).
Examples
import { countAt, settingsFor, startPosition } from "@johnmorrisdotca/sugoroku";
const settings = settingsFor("backgammon",{points:5,cube:true});
const spec = settings.variant;
const position = startPosition(spec);
console.log(countAt(position,"white",24));2What it prints (run when this page was built)