Function dicer::eval [−][src]
pub fn eval(src: &String) -> Result<Vec<EvalResult>, EvalError>
Simulates rolling dice for the given string
Example
use dicer::eval; let expr = String::from("1d20 + 4"); let results = eval(&expr).unwrap(); for res in results { println!("{} = {}", res.str, res.value); }