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

startCountsfunction

Which points a side's checkers start on, as an array indexed by own point 1 to 24 (index 0 is point 1).

Import it

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

Definition

function startCounts(spec: VariantSpec): number[]

Parameters

NameTypeDescription
specVariantSpec

The native variant specification.

Returns

number[]

Which points a side's checkers start on, as an array indexed by own point 1 to 24 (index 0 is point 1).

Examples

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

const settings = settingsFor("backgammon",{points:5,cube:true});
const spec = settings.variant;
console.log(startCounts(spec));
[
  0, 0, 0, 0, 0, 5, 0, 3,
  0, 0, 0, 0, 5, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 2
]

What it prints (run when this page was built)

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