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

pointsToGofunction

How many points a side still needs to win the match: 0 in money play, where there is no such thing.

Import it

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

Definition

function pointsToGo(match: Match, side: Side): number

Parameters

NameTypeDescription
matchMatch

The current immutable match and score.

sideSide

The side being examined: white or black.

Returns

number

How many points a side still needs to win the match: 0 in money play, where there is no such thing.

Examples

import { newMatch, pointsToGo, settingsFor } from "@johnmorrisdotca/sugoroku";

const settings = settingsFor("backgammon",{points:5,cube:true});
const match = newMatch(settings);
console.log(pointsToGo(match,"white"));
5

What it prints (run when this page was built)

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