jeudi 24 août 2017

Choose random value from array based on its value

I have an array: [45, 21, 12, 78, 4](ex.). I want to choose two values randomly based on its value (bigger number = higher probability of choosing).

How can I do that ?




Aucun commentaire:

Enregistrer un commentaire