How to get a random number with 'weight'?

BlitzMax Forums/BlitzMax Programming/How to get a random number with 'weight'?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

a=rnd (20)
if a <= NumberRed
red
else if a<= NumberRed+NumberBlack
Black
else if a<= NumberRed+NumberBlack+NumberBlue
Blue
endif endif endif