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

VARIANTSconstant

Every variant. Where each comes from, and where the sources disagree or say nothing, is in docs/VARIANTS.md.

Import it

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

Definition

const VARIANTS: Readonly<Record<VariantKey, VariantSpec>> = {
    backgammon: { ...BASE, key: "backgammon", layout: STANDARD_LAYOUT },
    "backgammon-race": { ...BASE, key: "backgammon-race", layout: [] },
    "anti-backgammon": { ...BASE, key: "anti-backgammon", layout: STANDARD_LAYOUT, goal: "last-off", drawAfter: 500 },
    nackgammon: {
        ...BASE,
        key: "nackgammon",
        layout: [
            [24, 2],
            [23, 2],
            [13, 4],
            [8, 3],
            [6, 4],
        ],
    },
    "long-gammon": { ...BASE, key: "long-gammon", layout: [[24, 15]] },
    hypergammon: {
        ...BASE,
        key: "hypergammon",
        checkers: 3,
        layout: [
            [24, 1],
            [23, 1],
            [22, 1],
        ],
    },
    tabula: {
        ...BASE,
        key: "tabula",
        layout: [],
        dice: 3,
        doubles: "none",
        direction: "same",
        opening: "die-each",
        holdBelow: 12,
    },
}

Members

NameTypeDescription
backgammonVariantSpec
backgammon-raceVariantSpec
anti-backgammonVariantSpec
nackgammonVariantSpec
long-gammonVariantSpec
hypergammonVariantSpec
tabulaVariantSpec

Examples

import { VARIANTS } from "@johnmorrisdotca/sugoroku";
console.log(VARIANTS);
{
  backgammon: {
    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] ]
  },
  'backgammon-race': {
    checkers: 15,
    dice: 2,
    doubles: 'four',
    direction: 'opposed',
    opening: 'roll-off',
    goal: 'first-off',
    holdBelow: 0,
    drawAfter: 0,
    key: 'backgammon-race',
    layout: []
  },
  'anti-backgammon': {
    checkers: 15,
    dice: 2,
    doubles: 'four',
    direction: 'opposed',
    opening: 'roll-off',
    goal: 'last-off',
    holdBelow: 0,
    drawAfter: 500,
    key: 'anti-backgammon',
    layout: [ [Array], [Array], [Array], [Array] ]
  },
  nackgammon: {
    checkers: 15,
    dice: 2,
    doubles: 'four',
    direction: 'opposed',
    opening: 'roll-off',
    goal: 'first-off',
    holdBelow: 0,
    drawAfter: 0,
    key: 'nackgammon',
    layout: [ [Array], [Array], [Array], [Array], [Array] ]
  },
  'long-gammon': {
    checkers: 15,
    dice: 2,
    doubles: 'four',
    direction: 'opposed',
    opening: 'roll-off',
    goal: 'first-off',
    holdBelow: 0,
    drawAfter: 0,
    key: 'long-gammon',
    layout: [ [Array] ]
  },
  hypergammon: {
    checkers: 3,
    dice: 2,
    doubles: 'four',
    direction: 'opposed',
    opening: 'roll-off',
    goal: 'first-off',
    holdBelow: 0,
    drawAfter: 0,
    key: 'hypergammon',
    layout: [ [Array], [Array], [Array] ]
  },
  tabula: {
    checkers: 15,
    dice: 3,
    doubles: 'none',
    direction: 'same',
    opening: 'die-each',
    goal: 'first-off',
    holdBelow: 12,
    drawAfter: 0,
    key: 'tabula',
    layout: []
  }
}

What it prints (run when this page was built)

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