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

Movetype

ONE CHECKER MOVED BY ONE DIE, in the mover's own numbering: from its own point from (or the BAR, 25, for a checker entering from the bar or from off the board at the start of a race) to its own point to (0 for borne off). A move that lands on a lone checker of the other side hits it.

Import it

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

Definition

type Move = {
    readonly from: number;
    readonly to: number;
    readonly die: number;
    readonly hit: boolean;
};

Members

NameTypeDescription
fromnumber
tonumber
dienumber

The number on the die that moved it. A checker borne off with a larger die than it needed has die greater than from.

hitboolean

Whether it hit a checker, which went to the other side's bar.

Examples

import { legalPlaysOf, newGame, rollOpening, settingsFor } from "@johnmorrisdotca/sugoroku";
import type { Move } from "@johnmorrisdotca/sugoroku";

const settings = settingsFor("backgammon",{points:5,cube:true});
const game = rollOpening(newGame(settings),[3,1]);
const play = legalPlaysOf(game)[0];
const move = play.moves[0];
const value: Move = move;
console.log(value);
{ from: 24, to: 21, die: 3, hit: false }

What it prints (run when this page was built)

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