How can I avoid the string of Random numbers repeating in QB64?
Posted: Fri Jan 23, 2015 11:49 pm
Brand, spankin' newbie here...
I'm simulating randomly created striations (scratches) on a pair of bullets and comparing them. This requires huge invocations of RND. There are 300 possible sites on each pair that are chosen to be either striation or non-striation using RND. After half a million or so pairs of bullets, the patterns generated recur because the length of the string of pseudo-random numbers that QB can make has been exceeded and the numbers begin to repeat. It makes no difference whether I RANDOMIZE with a seed number or with RANDOMIZE TIMER. I tried a line to the effect of IF RND>.95 THEN RANDOMIZE TIMER. No help. Any ideas?
Thanks in advance,
Rocky
I'm simulating randomly created striations (scratches) on a pair of bullets and comparing them. This requires huge invocations of RND. There are 300 possible sites on each pair that are chosen to be either striation or non-striation using RND. After half a million or so pairs of bullets, the patterns generated recur because the length of the string of pseudo-random numbers that QB can make has been exceeded and the numbers begin to repeat. It makes no difference whether I RANDOMIZE with a seed number or with RANDOMIZE TIMER. I tried a line to the effect of IF RND>.95 THEN RANDOMIZE TIMER. No help. Any ideas?
Thanks in advance,
Rocky