Files
ccc-obfuscated-code/node_modules/chance/docs/miscellaneous/rpg.md
Pipi Chen b8a3516cd6 update
2020-05-07 01:02:44 +08:00

432 B

rpg

// usage
chance.rpg('#d#')
chance.rpg('#d#', {sum: true})

Given an input looking like #d#, where the first # is the number of dice to roll and the second # is the max of each die, returns an array of dice values.

chance.rpg('3d10');
=> [1, 6, 9]

chance.rpg('5d6');
=> [3, 1, 2, 5, 2]

Optionally specify a sum be returned rather than an array of dice.

chance.rpg('3d10', {sum: true});
=> 14