In our previous episode, Dimitri Smits said: > > Randomize() is supposed to be called only once to seed the generator with an > initial value. > > If you made it something like so: > > begin > for i := 0 to 1000 do > begin > randomize(); > pixel[random(screenwidth),random(screenheight)]:= clSomeColor; > end; > end; > > then you seed with a timestamp before randoming and your distribution does > not change much with a lcg. Not the fault of the algorithm itself, just > your mistake of doing the randomize in the loop itself (like you mentioned > yourself).
(specially since high quality rng's might call OS dependent sources for initial entropy in that first call) _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal