Reference · Rules, games and records
inPlayfunction
Every checker of side that is still in the game: on the board, on the bar or yet to enter.
Import it
import { inPlay } from "@johnmorrisdotca/sugoroku";
Definition
function inPlay(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
Every checker of side that is still in the game: on the board, on the bar or yet to enter.
Examples
import { inPlay, settingsFor, startPosition } from "@johnmorrisdotca/sugoroku";
const settings = settingsFor("backgammon",{points:5,cube:true});
const spec = settings.variant;
const position = startPosition(spec);
console.log(inPlay(position,"white"));15What it prints (run when this page was built)