[No longer applies]
The code you posted doesn't compile. Once that's fixed, it still doesn't work. Because all of weights are larger than the maximum value returned by rand (slightly less than one), It always prints the first value returned by each.
In reply to Re: weighted biased dice roll
by ikegami
in thread weighted biased dice roll
by sys0p
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |