Reference · Rules, games and records
Settingstype
The settings of a game: the variant's row and the rules. What every game and match is made from.
Import it
import type { Settings } from "@johnmorrisdotca/sugoroku";
Definition
type Settings = {
variant: VariantSpec;
rules: Rules;
};
Members
| Name | Type | Description |
|---|---|---|
variant | VariantSpec | |
rules | Rules |
Examples
import { settingsFor } from "@johnmorrisdotca/sugoroku";
import type { Settings } from "@johnmorrisdotca/sugoroku";
const settings = settingsFor("backgammon",{points:5,cube:true});
const value: Settings = settings;
console.log(value);{
variant: {
checkers: 15,
dice: 2,
doubles: 'four',
direction: 'opposed',
opening: 'roll-off',
goal: 'first-off',
holdBelow: 0,
drawAfter: 0,
key: 'backgammon',
layout: [ [Array], [Array], [Array], [Array] ]
},
rules: {
points: 5,
cube: true,
crawford: true,
jacoby: false,
beaver: false,
gammons: false
}
}What it prints (run when this page was built)