Skip to the content

Sugoroku双六

Play backgammon and its relatives with native rules, cube and match scoring, seeded dice and replayable records.

Sugoroku is the Japanese name 双六 for games of tables. About the name

Contents

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

NameTypeDescription
specVariantSpec

The native variant specification.

ownnumber

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));
1

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/sugoroku 1.1.1.