diceyjs

1.0.0 • Public • Published

diceyjs

Javascript helper to roll dices for browsers and nodejs

Usage

There are many ways to use it. So use it as you may like.

var Dicey = require('./dicey.js');
Dicey.roll(3, 15); // Will return a random number from 3 to 15
Dicey.roll(50); // Will return a random number from 0 to 50
Dicey.roll('2d10'); // Will return a random number from 2 to 20

Randomizer Methods

By default are 5 randomizer methods.

NORMAL_ROLL : Just randomize, round the number and return it.

BEST_OF_TWO : Randomize twice and return the highest value.

BEST_OF_THREE : Randomize three times and return the highest value.

WORST_OF_TWO : Randomize twice and return the lowest value.

WORST_OF_THREE : Randomize three times and return the lowest value.

Example

Dicey.roll('2d10', 'BEST_OF_THREE');
Dicey.roll(10, 50, 'WORST_OF_THREE');

Readme

Keywords

Package Sidebar

Install

npm i diceyjs

Weekly Downloads

1

Version

1.0.0

License

ISC

Last publish

Collaborators

  • joaomosmann