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

boardPointfunction

The point on the board, 1 to 24 counting the way white counts, that is side's own point own. White's own numbers are the board's; black's are the board's reversed when the sides go opposite ways round.

Import it

import { boardPoint } from "@johnmorrisdotca/sugoroku";

Definition

function boardPoint(spec: VariantSpec, side: Side, own: number): number

Parameters

NameTypeDescription
specVariantSpec

The native variant specification.

sideSide

The side being examined: white or black.

ownnumber

A point in this side’s own numbering.

Returns

number

The point on the board, 1 to 24 counting the way white counts, that is side's own point own. White's own numbers are the board's; black's are the board's reversed when the sides go opposite ways round.

Examples

import { boardPoint, settingsFor } from "@johnmorrisdotca/sugoroku";

const settings = settingsFor("backgammon",{points:5,cube:true});
const spec = settings.variant;
console.log(boardPoint(spec,"black",24));
1

What it prints (run when this page was built)

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