Skip to content

mock-end/random-rpg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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](https://github.com/mock-end/random-rpg /issues/new).

About

Return an array of dice values.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published