Reference · Rules, games and records
pointsToGofunction
How many points a side still needs to win the match: 0 in money play, where there is no such thing.
Import it
import { pointsToGo } from "@johnmorrisdotca/sugoroku";
Definition
function pointsToGo(match: Match, side: Side): number
Parameters
| Name | Type | Description |
|---|---|---|
match | Match | The current immutable match and score. |
side | Side | The side being examined: white or black. |
Returns
number
How many points a side still needs to win the match: 0 in money play, where there is no such thing.
Examples
import { newMatch, pointsToGo, settingsFor } from "@johnmorrisdotca/sugoroku";
const settings = settingsFor("backgammon",{points:5,cube:true});
const match = newMatch(settings);
console.log(pointsToGo(match,"white"));5What it prints (run when this page was built)