Reference · Rules, games and records
inContactfunction
Whether the two sides can still hit one another. Once every checker of one side has gone past every checker of the other there is nothing more to play for but the race, and the game is a race.
Import it
import { inContact } from "@johnmorrisdotca/sugoroku";
Definition
function inContact(spec: VariantSpec, position: Position): boolean
Parameters
| Name | Type | Description |
|---|---|---|
spec | VariantSpec | The native variant specification. |
position | Position | The native checker counts, bar, reserve and borne-off counts. |
Returns
boolean
Whether the two sides can still hit one another. Once every checker of one side has gone past every checker of the other there is nothing more to play for but the race, and the game is a race.
Examples
import { inContact, settingsFor, startPosition } from "@johnmorrisdotca/sugoroku";
const settings = settingsFor("backgammon",{points:5,cube:true});
const spec = settings.variant;
const position = startPosition(spec);
console.log(inContact(spec,position));trueWhat it prints (run when this page was built)