Package Exports
- ya-roll
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ya-roll) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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"));
}