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§
- error
- evaluation
- Types used in the evaluation of dice expressions
- operator
- Types which represent operators
Traits§
- Range
Rng - 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 therandtherefore 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§
- eval_
with_ rand - Evaluates a string in format similar to Standard Dice Notation
evaluated with the given
RangeRng - eval_
with_ seed - A utility wrapper function for seeding a dice roll with the given u64 as the seed
(see
saikoro::eval_with_randfor more information) - evaluate
- Evaluates a string in format similar to Standard Dice Notation
evaluated with
rand::thread_rng. Equivalent toeval_with_randcalled with&mut rand::thread_rng()as the second parameter