mardi 24 février 2015

Java hashmap choose random but by chance

I have 2 hashmaps.



rewards<integer,integer>
chances<integer,integer>


rewards is like : 57,500000000;9210,2500;9209,50;6660,1;6 (id-count)


chances is like : 57,95;9210,70;9209,65;6660,15; (id-chance %) id is the same both maps.


So i want to choose one id but by these chances so low chances will have lower chance to be selected. i am fully confused. thanks you! (but i need to chooce 1 id , not zero not more than 1)





Aucun commentaire:

Enregistrer un commentaire