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

formatRecordHeaderfunction

The header lines of a record: its version, the variant, the rules and the seed.

Import it

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

Definition

function formatRecordHeader(settings: Settings, seed?: RecordSeed): string[]

Parameters

NameTypeDescription
settingsSettings

The resolved variant and complete rules.

seed (optional)RecordSeed | undefined

A reproducible numeric or text seed.

Returns

string[]

The header lines of a record: its version, the variant, the rules and the seed.

Examples

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

const settings = settingsFor("backgammon",{points:5,cube:true});
console.log(formatRecordHeader(settings,42));
[
  'sugoroku 1',
  'variant backgammon',
  'points 5',
  'cube on',
  'crawford on',
  'jacoby off',
  'beaver off',
  'gammons off',
  'seed 42'
]

What it prints (run when this page was built)

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