Function dicer::eval[][src]

pub fn eval(src: &String) -> Result<EvalResult, EvalError>

Simulates rolling dice for the given string

Example

use dicer::eval;
let expr = String::from("1d20 + 4");
let result = eval(&expr).unwrap();
println!("value: {}", result.value);
println!("intermediate rolls: {}", result.str);