Randomize
Previous  Next

Description: Changes the seed for the random number generator

     Syntax:
     
Randomize <Seed>

Part
Description
<Seed>
Optional. If omitted, the HV counter will be used as the seed.

NOTES: Changing the seed is essential for making sure that each number being coming out of the random number generator is unique. Having the same seed throughout the program will yield the same pattern of numbers coming out of the random number generator. Ignoring a value for seed will just substitute the video's HV counter for the seed. A good way to make use of getting pure random numbers is to place a Randomize statement right after a joypad routine has detected a key.

Example:

        Dim VarSeed As Integer
        Randomize VarSeed