Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

Rust Programming Tutorial #32 – Random Numbers (and Booleans)

13.5K views on YouTube

dcode 42 tutorials here

In order to use random numbers in Rust, you need to use the external ‘rand’ crate which you can list in your Cargo.toml file.

From there, you can use a random number generator in order to gain access to many provided methods including ones that can give you a random number within a range and also random boolean values.

If this video helped you out and you’d like to see more, make sure to leave a like and subscribe to dcode!