Randomising the chance that something will appear

BlitzMax Forums/BlitzMax Programming/Randomising the chance that something will appear

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.

Previously I've done things like populated and array with 1xA, 1xB, 1xC, 2xD, 5xE and then I've randomised a number from 1 to 10 and picked an array slot. That works fine, but if I want to use decimal places for my % chance then I'd have to make an array 1000+ or more slots long which is silly.

Is it? Modern PCs have tons of RAM -- you might as well use it. I don't believe for a second that you really need to account for nths of a percent in the context of a videogame deciding whether to give someone a lemon or a melon though. :D What you were already doing -- do that.