[][src]Function roll_dice::roll

pub fn roll(amount: u32, faces: NonZeroU32) -> Vec<u32>

Roll the Dice and return results of the Roll for each Die.

Examples

Roll 3d6 3 six-sided die and get sum of the results


let rolled = roll(3, NonZeroU32::new(6).unwrap() );
let sum: u32 = rolled.iter().sum();

assert!(sum > 2 && sum < 19)