pub fn solve_dice_expression(
expression: &str,
random_seed: Option<u64>,
) -> Result<i64>
Expand description
Solves a dice expression string by rolling each dice in-place and then evaluating the resulting arithmetic expression.
use dicelib::solve_dice_expression;
let result = solve_dice_expression(&"2d5 + 4".to_string(), None).unwrap();
assert!(result >= 6 && result <= 14);
ยงErrors
- Integer overflow from huge dice rolls.