08-16-2010, 07:44 PM
LCD Wrote:Another bug i discovered in the latest dev version is that RANDOMIZE does not change the seed.I will debug this. But RANDOMIZE now relies in 32 Bit seeds being lower 16-bit SEED system var (23670, 23671) and two upper 16bits in a reserved memory position. I will check this bug.
I got exactly the same RND numbers with RANDOMIZE 0 as with RANDOMIZE 1 or even RANDOMIZE (without number, after a pause 0 to avoid the fact that the emulator always starts with frame count 0 and uses it as Seed.
Here is the evidence:
There is a way around it:Code:print "Actual Seed: ";peek (uinteger,23670)
randomize 45
print "Seed after Random 45: ";peek (uinteger,23670)
randomize 37
print "Seed after Random 37: ";peek (uinteger,23670)
randomize
print "Randomized seed: ";peek (uinteger,23670)
This does not rely on RANDOMIZE, it just copies two bytes from frames sysvar to seed sysvar, and gives you every time you start a program, new RND sequence (After a PAUSE 0 or selecting controls).Code:poke uinteger 23670,peek (uinteger,23672)
Thanks!