Random Seeding

Archives Forums/Blitz3D Bug Reports/Random Seeding

_PJ_(Posted 2013) [#1]
Not sure if it should be considered a 'bug', or merely an artefact of the algorithm(s) used in generating the random numbers.

However, even if just for information's sake, I figured it might be interesting if not useful to make a note here of the unexpected observations:

Ratehr than try to describe what may or may not be occurring, I figured a simple demonstration should highlight the results:

For x = -1 To 1
	SeedRnd x
	Text 100+(x*100),0,x
		
	For y=0 To 10
		Text 100+(x*100),(y+1)*20,Rnd(0,1);LSet(Rnd(0,1),10)
	Next
Next


Then, I also tried substituting to give a perceived variation in the range of result values by extending Rnd(*0,1) with Rnd(y)...

For x = -1 To 1
	SeedRnd x
	Text 100+(x*100),0,x
		
	For y=0 To 10
		Text 100+(x*100),(y+1)*20,Rnd(y);LSet(Rnd(0,1),10)
	Next
Next


_____

Edit:

For those with Blitz Plus, adding in a means to set the display buffer and running the same tests gives slightly different but equally suprising results!