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

cubeInPlayfunction

Whether the cube is in play in a game of a match, given whether this is the Crawford game.

Import it

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

Definition

function cubeInPlay(rules: Rules, crawfordGame: boolean): boolean

Parameters

NameTypeDescription
rulesRules

The complete or partial native rules specified by the signature.

crawfordGameboolean

Whether this is the match’s cube-free Crawford game.

Returns

boolean

Whether the cube is in play in a game of a match, given whether this is the Crawford game.

Examples

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

const settings = settingsFor("backgammon",{points:5,cube:true});
console.log(cubeInPlay(settings.rules,false));
true

What it prints (run when this page was built)

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