I\'m trying to implement a weighted random numbers. I\'m currently just banging my head against the wall and cannot figure this out.
In my project (Hold\'em hand-ran
Build a bag (or std::vector) of all the items that can be picked.
Make sure that the number of each items is proportional to your weighting.
Example:
So have a bag with 100 items with 60 1's, 35 2's and 5 3's.
Now randomly sort the bag (std::random_shuffle)
Pick elements from the bag sequentially until it is empty.
Once empty re-randomize the bag and start again.