Skip to main content

weighted_range

Function weighted_range 

Source
pub fn weighted_range(choices: &[(u32, RangeInclusive<u16>)]) -> u16
Expand description

Picks a random value from a slice of weighted ranges.

Each tuple contains (weight, range). A higher weight increases the probability of choosing a value from that range.