random-rpg
Return an array of dice values.
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, then returns an array of dice values.
Install
$ npm install --save random-rpg
Usage
var randomRpg = ; // API// - randomRpg(schema[, options]); ;// => [1, 6, 9] ;// => [3, 1, 2, 5, 2]
Optionally specify a sum be returned rather than an array of dice.
;// => 14
Related
- random-uuid - Return a random uuid.
- random-identity - Return a random ID.
- random-dx - Return a value equal to the roll of a die.
- random-hexhash - Return a random hex hash.
- random-normal - Return a normally-distributed random variate.
- random-rpg - Return an array of dice values.
- random-file - Return a random file name with random extension.
- random-semver - Return a random semver version.
Contributing
Pull requests and stars are highly welcome.
For bugs and feature requests, please create an issue.