Reference · Rules, games and records
mirrorPointfunction
The other side's own number for the point that is side's own point own.
With the sides going opposite ways round, a side's 24-point is the other's
1-point; going the same way, a point has the one number for both.
Import it
import { mirrorPoint } from "@johnmorrisdotca/sugoroku";
Definition
function mirrorPoint(spec: VariantSpec, own: number): number
Parameters
| Name | Type | Description |
|---|---|---|
spec | VariantSpec | The native variant specification. |
own | number | A point in this side’s own numbering. |
Returns
number
The other side's own number for the point that is side's own point own. With the sides going opposite ways round, a side's 24-point is the other's 1-point; going the same way, a point has the one number for both.
Examples
import { mirrorPoint, settingsFor } from "@johnmorrisdotca/sugoroku";
const settings = settingsFor("backgammon",{points:5,cube:true});
const spec = settings.variant;
console.log(mirrorPoint(spec,24));1What it prints (run when this page was built)