ParaDice
An extensible dice gem.
Introduction
ParaDice is a ruby library that provides customizable dice and results of rolling one or more.
Installation
Add this line to your application's Gemfile:
gem 'para_dice'
And then execute:
$ bundle
Or install it yourself as:
$ gem install para_dice
Usage
require para_dice
# Use a set of polyhedral dice
bag = ParaDice::GenerateDiceBag.poly
# Get a dice cup to roll 3 d6 in this case
cup = bag.take_cup([:d6, :d6, :d6])
cup.roll! # [4, 2, 4]
result = cup.roll # ParaDice::Results::Sum object
result.raw # [4,2,
Contributing
- Fork it ( https://github.com/anithri/para_dice/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request