destiny
A simple library for parsing and evaluating dice strings for use in tabletop gaming.
Examples
Roll some dice using destiny::parse_dice_string:
use parse_dice_string;
println!;
println!;
println!;
println!;
println!;
Calculate distributions using destiny::DiceDistribution:
use DiceDistribution;
let dd = new;
dd.ptable;
/* this will output:
+------+--------+--------+
| Roll | #Rolls | Roll% |
+======+========+========+
| 2 | 1 | 2.78% |
+------+--------+--------+
| 3 | 2 | 5.56% |
+------+--------+--------+
| 4 | 3 | 8.33% |
+------+--------+--------+
| 5 | 4 | 11.11% |
+------+--------+--------+
| 6 | 5 | 13.89% |
+------+--------+--------+
| 7 | 6 | 16.67% |
+------+--------+--------+
| 8 | 5 | 13.89% |
+------+--------+--------+
| 9 | 4 | 11.11% |
+------+--------+--------+
| 10 | 3 | 8.33% |
+------+--------+--------+
| 11 | 2 | 5.56% |
+------+--------+--------+
| 12 | 1 | 2.78% |
+------+--------+--------+
*/