Skip to content

🎲 A dice roller / random number generator

License

Notifications You must be signed in to change notification settings

nothingrandom/roll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

roll

Travis (.com)

A dice roller / random number generator

Install

$ yarn global add @nothingrandom/roll
$ npm install --global @nothingrandom/roll

Usage (CLI)

$ roll --help

  Usage
    $ roll <dice to roll>

  Example
    $ roll d20 # rolls one die with 20 sides
    1 - 20

    $ roll 2d20 # rolls two dice with 20 sides each
    2 - 40

    $ roll 2d20+d3 # rolls two dice with 20 sides and one die with 3 sides
    3 - 43

Usage (require in JS)

const Roll = require('@nothingrandom/roll');
const roll = new Roll();

roll.roll('2d20').result;

// roll.roll(INPUT) will return
// {
//   rolled: number,
//   average: number[],
//   result: number,
// }

License

MIT © Benjamin Grant

About

🎲 A dice roller / random number generator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published