[][src]Function destiny::roll_complexity

pub fn roll_complexity(dice_string: &str) -> i64

Calculates the complexity of a roll. This counts the total number of possible dice combinations. This is usefull if you want to make sure a dice roll is resonable to calculate before trying it. The best use case for this is if you are taking user input. if a user tries to calculate the distribution of "8d10" the there are 100,000,000 possible dice rolls. Calculating a distribution on this would take a very long time.

Examples

use destiny::roll_complexity;
 
let num_possibilities = roll_complexity("8d10");
assert_eq!(num_possibilities, 100_000_000)