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

VariantSpectype

A native variant’s checker counts, starting layout, dice, directions, opening and winning goal.

Import it

import type { VariantSpec } from "@johnmorrisdotca/sugoroku";

Definition

type VariantSpec = {
    readonly key: VariantKey;
    readonly checkers: number;
    readonly layout: readonly (readonly [
        number,
        number
    ])[];
    readonly dice: 2 | 3;
    readonly doubles: "four" | "none";
    readonly direction: Direction;
    readonly opening: Opening;
    readonly goal: Goal;
    readonly holdBelow: number;
    readonly drawAfter: number;
};

Members

NameTypeDescription
keyVariantKey
checkersnumber

Checkers each side has.

layoutreadonly (readonly [number, number])[]

Where the checkers are at the start, as [own point, how many]. Empty for a start with every checker off the board.

dice2 | 3

How many dice a roll is: two, or three for Tabula.

doubles"four" | "none"

Whether doubles are played four times (four) or are an ordinary roll (none).

directionDirection
openingOpening
goalGoal
holdBelownumber

While any checker is still to enter the board, no checker may land on this own point or any below it. 0 for no such rule. Tabula holds every checker in the first half until all fifteen are in.

drawAfternumber

A game that reaches this many turns for each side is a draw. 0 for no limit.

Examples

import { settingsFor } from "@johnmorrisdotca/sugoroku";
import type { VariantSpec } from "@johnmorrisdotca/sugoroku";

const settings = settingsFor("backgammon",{points:5,cube:true});
const spec = settings.variant;
const value: VariantSpec = spec;
console.log(value);
{
  checkers: 15,
  dice: 2,
  doubles: 'four',
  direction: 'opposed',
  opening: 'roll-off',
  goal: 'first-off',
  holdBelow: 0,
  drawAfter: 0,
  key: 'backgammon',
  layout: [ [ 24, 2 ], [ 13, 5 ], [ 8, 3 ], [ 6, 5 ] ]
}

What it prints (run when this page was built)

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