Reference · Rules, games and records
diceToPlayfunction
The dice a roll gives to play, highest first: a double of a game that plays doubles four times is four of them.
Import it
import { diceToPlay } from "@johnmorrisdotca/sugoroku";
Definition
function diceToPlay(spec: VariantSpec, roll: readonly number[]): number[]
Parameters
| Name | Type | Description |
|---|---|---|
spec | VariantSpec | The native variant specification. |
roll | readonly number[] | The valid dice as thrown, in throw order. |
Returns
number[]
The dice a roll gives to play, highest first: a double of a game that plays doubles four times is four of them.
Examples
import { diceToPlay, settingsFor } from "@johnmorrisdotca/sugoroku";
const settings = settingsFor("backgammon",{points:5,cube:true});
const spec = settings.variant;
console.log(diceToPlay(spec,[3,3]));[ 3, 3, 3, 3 ]What it prints (run when this page was built)