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§
- Types used in the evaluation of dice expressions
- Types which represent operators
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 therand
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§
- Evaluates a string in format similar to Standard Dice Notation evaluated with the given
RangeRng
- A utility wrapper function for seeding a dice roll with the given u64 as the seed (see
saikoro::eval_with_rand
for more information) - Evaluates a string in format similar to Standard Dice Notation evaluated with
rand::thread_rng
. Equivalent toeval_with_rand
called with&mut rand::thread_rng()
as the second parameter