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.

@Tachyon,

Whilst yours looks smaller than mine. Yours has to go through every If statment every time, whereas mine stops going through them when the condition is satisfied.
(If you wish to counter argue that mine has all those additions, I would point out that so does yours, but you just havent put them in. ie you ether pre calculate the "Weights" or you dont)