Crate saikoro

source ·
Expand description

A parser and evaluator for dice notation expression

§Basic Usage example

// roll for fireball damage
let damage = saikoro::evaluate("8d6")?;
println!("Fireball deals {} fire damage", damage.value);

Modules§

Traits§

  • A utility trait for allowing flexibility for testing or rigging saikoro’s random number generation. All implementers of rand::RngCore (i.e. all RNGs from the rand therefore ones one is likely to use) get an implementation of this trait for free, so most will not need to implement this trait, but it is availale publicly for those who do

Functions§