samedi 22 septembre 2018

How to generate a random dice roll in Rust?

How you I generate a random dice roll in Rust?

I know I can use rand::random, but that requires I want to generate a value of an integer type. Using rand::random<u8>() % 6 introduces a bias.




Aucun commentaire:

Enregistrer un commentaire