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
| Name | Type | Description |
|---|---|---|
settings | Settings | 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)