dimanche 15 mars 2020

Generate a rand(6) function from a rand(9) function [duplicate]

Given a function that generates numbers between [0,8] create a function that generates numbers between [0,5].

Multiplying by 2/3 gives an uneven distribution. Where 0, 2, 4 occur twice as many times as 1, 3 and 5.
How can this be done?




Aucun commentaire:

Enregistrer un commentaire