One D Six
Rolls some dice
Usage
From Command Line
# Install
# Print help
# Print total of each dice
# Print each die cast of each dice roll
As Library
This is not complete usage documentation. This is the expected most common usage.
use ;
// Quickly generates a set of Dice and rolls them
// quickroll can return any int type (i8 - isize, u8 - usize)
let coinflip: u8 = quickroll;
if coinflip == 1 else
// Creating sets of dice
let set_1 = new; // Creates 2d4 with Dice::new
let set_2 = "1d20".parse.unwrap; // Creates 1d20 by parsing str
// Combining sets of dice
let mut dice = set_1 + set_2; // Creates 2d4 + 1d20
// Prints 50 rolls of the dice set
for _ in 0..50
// Getting value of each die cast
let _results = format!;
Want to roll for your own custom type? Just implement one_d_six::Rollable
on MyCustomType
, and
then you can create a new Die<MyCustomType>
!