True RND

Blitz3D Forums/Blitz3D Programming/True RND

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

The first number would be truly random - at least as random as the external source. The following numbers in the series would not, however.

If you want a "more random" seed than Millisecs(), you can add user input. Most of the time, the player will take a different number of milliseconds to press a key after the game has started. Multiply that by Millisecs() and you've got a much better seed.

The standard C rand() - as used by Blitz I think - isn't terribly good at distributing random numbers though. If you need something awesome, look into the Mersenne Twister.