Skip to content

Function: rollHeld() ​

ts
function rollHeld(
   previous, 
   held, 
   source?, 
   at?
): Roll;

Defined in: src/dice.ts:1038

Hold some dice of a roll and throw the rest again, as Yacht and Farkle do. held[i] is whether face i stays. The dice not held are thrown in order from the source, so from a seed the second roll replays like the first. The roll that comes back says which faces were held. Only plain dice can be held (canHold); anything else is a RangeError, as is a held that does not fit the roll.

Parameters ​

previous ​

Roll

held ​

readonly boolean[]

source? ​

RandomSource = ...

at? ​

number = ...

Returns ​

Roll

MIT © John Morris