The random number generator in GCBASIC is a 16 bit linear feedback shift register, which is explained pretty well at .
Generally, yes, you will get the same sequence every time it is used. However, you can seed it so that it will start at a different point at the sequence using the Randomize command. If you wanted to use an analog reading to seed the generator, this would work:
Randomize ReadAD10(AN0)
It appears I have neglected to cover this in the help, will write an article about it soon.
How does the random number generator work?
Is there a way of seeding it or do you get the same sequence each time it is called.
The random number generator in GCBASIC is a 16 bit linear feedback shift register, which is explained pretty well at .
Generally, yes, you will get the same sequence every time it is used. However, you can seed it so that it will start at a different point at the sequence using the Randomize command. If you wanted to use an analog reading to seed the generator, this would work:
Randomize ReadAD10(AN0)
It appears I have neglected to cover this in the help, will write an article about it soon.
: http://en.wikipedia.org/wiki/Linear_feedback_shift_register