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

inContactfunction

Whether the two sides can still hit one another. Once every checker of one side has gone past every checker of the other there is nothing more to play for but the race, and the game is a race.

Import it

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

Definition

function inContact(spec: VariantSpec, position: Position): boolean

Parameters

NameTypeDescription
specVariantSpec

The native variant specification.

positionPosition

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

Returns

boolean

Whether the two sides can still hit one another. Once every checker of one side has gone past every checker of the other there is nothing more to play for but the race, and the game is a race.

Examples

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

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

What it prints (run when this page was built)

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