[ad_1]
Suppose I’ve a sport with 6 gamers, every of which will get a payout on a special facet of a D6 roll. The D6 is rolled many instances over the course of the sport.
This yields a fair payout in the long term, utilizing an unbiased D6. However, my sport will not be lengthy sufficient for the payouts to revert to the imply. Therefore, I wish to make a biased cube mechanism, the place rolls that haven’t come up not too long ago are extra doubtless.
One method I can consider is to simulate a deck of playing cards:
- Take a listing
[ 1, 2, 3, 4, 5, 6 ]
- Repeat the checklist
n
instances (the placen
is a few a number of of the everyday sport size) - Shuffle the checklist
- To make a “roll”, pop a quantity off of the checklist
The downside with this method is selecting n
… too low and we danger operating out of rolls; too excessive and the rolls usually are not biased sufficient.
What algorithms / strategies can be found right here?
It can be useful if the algorithm might be simply defined to the participant.
[ad_2]