I need to find a way of picking winners, for like a race. Each racer has a weight of the chances of winning..
for instance
A - 25% chance to win
B - 10% chance to win
C - 25% chance to win
D - 10% chance
E - 10% chance
F - 20% chance
1) I need to pick the winner randomly but need to take the weighting in consideration.
2) I also need to pick the second most likely winner and the third...
I could pick the first by generating a random winner between 1-100 and basically splitting 100 among the racers depending on there chances like:
A = 1-25
B = 26 -35
C = 36-60.
etc
etc
Not sure how the stability of the above, but seemed okay.
Any more ideas?