jeudi 23 juin 2022

how to pick random number in an array but have more chance to pick the number if the number is bigger

example: I have an array of numbers like [1.0231, 1.1233, 2.1322, 2.321] I want to have like 35% pick 2.1322 and 40% to pick 2.321 and the rest for the other numbers.

I want a system that choose randomly but more odds to pick a number the bigger it is.




Aucun commentaire:

Enregistrer un commentaire