Pseudo-random number needed

Rng::gen_range
you have to pull that Trait into scope to use it:

use rand::Rng;

The rand crate provides many rngs to choose from, why implement your own?

And yes, Rust isn't the easiest language. The Rust Book only describes the basics, and you are unlikely to have much luck without understanding them.

2 Likes