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

Settingstype

The settings of a game: the variant's row and the rules. What every game and match is made from.

Import it

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

Definition

type Settings = {
    variant: VariantSpec;
    rules: Rules;
};

Members

NameTypeDescription
variantVariantSpec
rulesRules

Examples

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

const settings = settingsFor("backgammon",{points:5,cube:true});
const value: Settings = settings;
console.log(value);
{
  variant: {
    checkers: 15,
    dice: 2,
    doubles: 'four',
    direction: 'opposed',
    opening: 'roll-off',
    goal: 'first-off',
    holdBelow: 0,
    drawAfter: 0,
    key: 'backgammon',
    layout: [ [Array], [Array], [Array], [Array] ]
  },
  rules: {
    points: 5,
    cube: true,
    crawford: true,
    jacoby: false,
    beaver: false,
    gammons: false
  }
}

What it prints (run when this page was built)

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