DiceApi
Defined in: src/dice.ts:77
dice() totals; dice.detail() reports what each die showed.
Example
Section titled “Example”dice("3d6"); // 11dice("d20"); // 17dice("2d10+3"); // 14dice("1d4-1"); // 2
dice.detail("4d6+2"); // { total: 17, dice: [ 3, 6, 2, 4 ], modifier: 2 }DiceApi(
notation):number
Defined in: src/dice.ts:78
dice() totals; dice.detail() reports what each die showed.
Parameters
Section titled “Parameters”notation
Section titled “notation”string
Returns
Section titled “Returns”number
Example
Section titled “Example”dice("3d6"); // 11dice("d20"); // 17dice("2d10+3"); // 14dice("1d4-1"); // 2
dice.detail("4d6+2"); // { total: 17, dice: [ 3, 6, 2, 4 ], modifier: 2 }Properties
Section titled “Properties”detail
Section titled “detail”detail: (
notation) =>Roll
Defined in: src/dice.ts:79
Roll notation and return every die alongside the total.
Parameters
Section titled “Parameters”notation
Section titled “notation”string