Skip to content

Limits ​

All of these are exported constants, and the notation refuses anything past them by name.

LimitValueConstant
Dice in one roll1 to 10MIN_DICE, MAX_DICE
Dice in one roll, asked for from codeup to 100, all plainMAX_DICE_BY_CODE
Sides of dice that all differ100MAX_UNIQUE_SIDES
A number in a formula9999MAX_MATH_NUMBER
The span of a formula's totals1,000,000MAX_MATH_TOTALS
Kinds of dice in one roll4MAX_GROUPS
Rerolls until clear, for each die10MAX_REROLLS
Faces of a custom die2 to 20MAX_FACES
Characters in a custom face16MAX_LABEL
A custom face's value−9999 to 9999MAX_FACE_VALUE
A loaded dieup to 100 sides, weights 0 to 99MAX_LOADED_SIDES, MAX_WEIGHT
Sets kept on a device50, names up to 40 charactersMAX_SETS, MAX_SET_NAME
Sides of a die2 to 1000, or FMIN_SIDES, MAX_SIDES
Bonus−99 to +99MAX_MODIFIER
Explosions for each die10 more diceMAX_EXPLOSIONS
Largest die that may exploded100MAX_EXPLODING_SIDES
Times a roll is thrown in one go1 to 100 (1 to 10 in the tray)MAX_TIMES
A roll's label40 charactersMAX_ROLL_LABEL
Rolls kept in a history500HISTORY_LIMIT
Length of notation read400 characters

More than ten dice ​

The tray and typed notation stop at ten dice: that is what fits a felt, and what a table throws. Code may ask for up to a hundred:

ts
const volley = parseNotation("40d6", { maxDice: 100 })!;         // null without the option
normalizeSpec({ count: 40, sides: 6 }, { maxDice: 100 }).count;  // 40; 10 without it
roll(volley, seededSource("table"), { maxDice: 100 }).faces.length;  // 40; 10 without it
expectedTotal(volley);            // 140
chanceAtLeast(volley, 150);       // 0.1902
exactCounts(volley)!.outcomes;    // 6 to the 40th, a whole number of 32 digits

The one option, maxDice, is the same on all three, and on rollMany. Each stops at ten without it, as it always has: roll({ count: 50, sides: 6 }) throws ten dice. roll's third argument is the time of the roll, as before, or { at, maxDice }. On the command line it is --max-dice 100.

Past ten, every kind has to be plain dice: fair numbered or Fate dice, all added or one kept (100d20kh1), which is where the odds stay exact and quick however many there are. Anything else past ten is refused by name.

MIT © John Morris