random-rpg

1.0.0 • Public • Published

random-rpg

MIT License

build:? coverage:?

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 = require('random-rpg ');
 
// API
// - randomRpg(schema[, options]);
 
randomRpg('3d10');
// => [1, 6, 9]
 
randomRpg('5d6');
// => [3, 1, 2, 5, 2]

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

randomRpg('3d10', {sum: true});
// => 14

Related

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.

Package Sidebar

Install

npm i random-rpg

Weekly Downloads

35

Version

1.0.0

License

MIT

Last publish

Collaborators

  • bubkoo