mardi 21 juin 2016

How to generate random number that has lower chance of being bigger? [duplicate]

This question already has an answer here:

I have list of integers and I want to randomly choose one based on chances, lower integers has higher chances:

1 - 75%
3 - 25%

and the list would be bigger, like 300 or up to 1000

How can I do this easiest way? :)

(JS)




Aucun commentaire:

Enregistrer un commentaire