I disagree with the answer in its entirety.
Reseeding a random number generator with numbers from that generator is really Not A Good Idea.
Did you bother to read my response, Luke? I said, do try to reseed, and the
same pattern occurs.
Edit: on re-read of Dav's original program, he does multiply Rnd by large numbers initially. But then, adds this constant bias of 20. So my initial response was not quite right, but still, it's not the PRNG causing the problem.
Your options for better randomness are:
- Implement your own random number generator. Algorithms for such are available on the internet and should be able to give decent performance with not too large an implementation.
And that will not solve the problem, if you continue to add a constant bias of 20, to draw the lines.
I've provided two programs to test the reasonable actual results of the built-in PRNG. It's not that bad, certainly not at drawing random dots of a flat screen. Try it. Works pretty darned well.
Rem Program creates dots using random x and y coordinates
Rem -------
Do
Call Initialize
Call DrawDots
Loop
End
Sub Initialize
_Title "Random Number Distribution"
Screen _NewImage(840, 480, 12)
Cls
End Sub
Sub DrawDots
Randomize Timer
Color 9
Print "First random number this cycle"; Rnd
Do
x = Rnd * 840
y = Rnd * 480
Circle (x, y), 1, 14
_Delay .005
If InKey$ = Chr$(27) Then Exit Do
Loop
Cls
Locate 15, 35
Input "Start with new seed (y/n)"; cont$
If cont$ = "n" Then End
End Sub