ya-roll

0.1.1 • Public • Published

ya-roll

Yet Another dice Rolling module.

There are many excellent dice rolling modules out there. You should probably check them out. I decided to write my own mainly to play around with building a chainable API.

var Roll = require('ya-roll');

var check = Roll(10).orAbove().onDice(3).withSides(6);

console.log("Probability of passing check: " + check.chance());

if (check.result()) {
  console.log("You pass!");
} else {
  console.log("You fail!");
}

var manyResults = check.results(10);
for (var i = 0; i < manyResults.length; ++i) {
  console.log("Check " + i + ": " + (manyResults[i] ? "passed" : "failed"));
}

Dependents (0)

Package Sidebar

Install

npm i ya-roll

Weekly Downloads

0

Version

0.1.1

License

BSD

Last publish

Collaborators

  • wanderview