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

allHomefunction

Whether every checker of side still in play is in its home board (own points 1 to 6): the condition for bearing off.

Import it

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

Definition

function allHome(position: Position, side: Side): boolean

Parameters

NameTypeDescription
positionPosition

The native checker counts, bar, reserve and borne-off counts.

sideSide

The side being examined: white or black.

Returns

boolean

Whether every checker of side still in play is in its home board (own points 1 to 6): the condition for bearing off.

Examples

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

const settings = settingsFor("backgammon",{points:5,cube:true});
const spec = settings.variant;
const position = startPosition(spec);
console.log(allHome(position,"white"));
false

What it prints (run when this page was built)

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