Generation

generate functionSat, 12 Nov 2022

Fill vector with random integers

fn fill_with_random_integers(v: &mut Vec<int>) { let mut rng = rand::task_rng(); for i in range(0, v.len()) { v[i] = rng.gen_range(-10, 10); } }

Questions about programming?Chat with your personal AI assistant