Hi there.
Yet another new crazy post today. I've got this bit of code, and I expected the pixels to draw in a random direction outward from the center of the screen. But instead the pixels always gravitate towards the bottom left corner of the screen.
Can someone tell me what very obvious thing I'm missing that causes this code to always trend in the same direction, regardless of the random seed?
Thanks in advance.
Yet another new crazy post today. I've got this bit of code, and I expected the pixels to draw in a random direction outward from the center of the screen. But instead the pixels always gravitate towards the bottom left corner of the screen.
Graphics 1024,768,32,0 SetBuffer BackBuffer() SeedRnd MilliSecs() x = 1024/2 y = 768/2 ;********** While Not KeyHit(1) count# = MilliSecs() Repeat direction = Rnd(1,4) Select True Case direction = 1 x=x+1: If x >1024 Then x = 1024 Case direction = 2 x=x-1: If x < 0 Then x = 0 Case direction = 3 y=y+1: If y > 768 Then y = 768 Case direction = 4 y=y-1: If y < 0 Then y = 0 Default End Select Color Rnd(0,255),Rnd(0,255),Rnd(0,255) Plot x,y Until MilliSecs()-count# >= 1000/60 CopyRect 0,0,1024,768,0,0,BackBuffer(),FrontBuffer() Wend ;**********
Can someone tell me what very obvious thing I'm missing that causes this code to always trend in the same direction, regardless of the random seed?
Thanks in advance.