Randomize()

Randomize() it changes the seed for random numbers making them more random. It's a good idea to use the game timer as the seed.

Run the test several times with the randomizer, notice the numbers are different. Take out the randomize timer line and do more tests, without the randomize line the numbers are the same everytime.

Option Explicit
randomize timer 'Take the timer and use it as the seed
print rnd(1)
print rnd(1)
print rnd(1)
sleep
end
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution 2.5 License.