Worst random numbers ever!

Blitz3D Forums/Blitz3D Programming/Worst random numbers ever!

I've seen some baffling bugs, but this one is something special.

; Here is a strange Blitz3D bug. Tested with 1.88, probably affects all versions.

; This should fill the screen with random dots.
; But after a few seconds a pattern begins to emerge.


magic = 412005   ; Incredibly, 412005 is the one number which shows the bug.


Graphics 640, 480, 0, 1                                                                                                                                                                  :f=LoadFont(" ",72):SetFont f:img=CreateImage(320,120):ib=ImageBuffer(img):SetBuffer ib:Text 44,24,"BlitzMax"
SetBuffer FrontBuffer()


SeedRnd magic

Repeat

	r = Rand(50,150)  :  g = Rand(50,150)  :  b = Rand(50,150)
	x = Rand(0,640)   :  y = Rand(0,480)
	                                                                                                                                                                                        If magic=412005 Then If ReadPixel(x Mod 320 ,y Mod 120,ib) And $FF Then r=r+155:g=g+155:b=b+155	
	Color r,g,b  :  Plot x,y
	
	n = n + 1  :  If (n Mod 10)=0 Then Delay 1  
	
Until KeyDown(1)