Generate random numbers.
cargo add rand
Generate a random number within a range:
use rand::Rng; fn main() { let mut rng = rand::thread_rng(); println!("Random number from 0 to 99: {}", rng.gen_range(0..100)); }