bracket-random 0.8.7

Random number generator (xorshift based), focused on dice rolling. Optionally includes parsing of RPG-style dice strings (e.g. "3d6+12"). Part of the bracket-lib family.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use bracket_random::prelude::*;

fn main() {
    let mut rng = RandomNumberGenerator::new();
    let mut total = 0;
    println!("Rolling 3d6, 10 times.");
    for _ in 0..10 {
        let d6roll = rng.roll_str("3d6").expect("Parse fail");
        total += d6roll;
        println!("3d6 Roll: {}", d6roll);
    }
    println!("Total of rolls: {}", total);
}