For those that know why you want consistant pseudo random numbers out of your random number generator...
www.obsidianobelisk.com/software/mersenne.zip
Just copy the directory in the zip to your pub.mods directory and you should be set. There's a text file in the docs subdirectory with the commands available.
Commands:
SeedRand(seed%) - seed the random number generator
x% = Rand32() - return the next number in PRNG
x% = RandMax(max%) - return random number from 1 - max
x% = RandRange(lo%, hi%) - return random number from lo - hi
Oh... It was made from some freeware C conversion I found floating around on the net. I tweaked it a bit to create a dll and work with blitz+ and blitz3d (see those forums for the userlib), and reworked it a bit to create the blitzmax module, but other than that...
Tests indicate it to work well across CPUs... Despite Mark's protestations to the contrary. So there you go...
Kanati
[edit] and in case it isn't clear, it's freeware... do with it what you will. Mark... feel free to email me if you want the source so you can fix blitz.
www.obsidianobelisk.com/software/mersenne.zip
Just copy the directory in the zip to your pub.mods directory and you should be set. There's a text file in the docs subdirectory with the commands available.
Commands:
SeedRand(seed%) - seed the random number generator
x% = Rand32() - return the next number in PRNG
x% = RandMax(max%) - return random number from 1 - max
x% = RandRange(lo%, hi%) - return random number from lo - hi
Oh... It was made from some freeware C conversion I found floating around on the net. I tweaked it a bit to create a dll and work with blitz+ and blitz3d (see those forums for the userlib), and reworked it a bit to create the blitzmax module, but other than that...
Tests indicate it to work well across CPUs... Despite Mark's protestations to the contrary. So there you go...
Kanati
[edit] and in case it isn't clear, it's freeware... do with it what you will. Mark... feel free to email me if you want the source so you can fix blitz.