mercredi 20 septembre 2017

Specific point in random number generation of 7 using rand5

I understand this question has been answered. My specific question is

everywhere people are using (5 * rand5() + rand5()) - 1 (1-29) and then keep doing until they hit <= 21 and then % 7

why not just

(rand5() + rand5() + rand5() - 1) % 7 + 1




Aucun commentaire:

Enregistrer un commentaire