grml wrote: ↑Sat Jan 21, 2023 7:45 pm BruceRMcF wrote: ↑Sat Jan 21, 2023 5:12 pm
Does anything interesting happen with RND(T) in one of the RND() functions ... that is, using a different seed each time through the loop?
Frequent reseeding usually just results in boring, easily predictable numbers.
Oh, wait, it's been a long time since I've used CBM2.0 RND. If a RTC is running in the X16 (in the C64 the clock had to be started up, and it was only close to "Real Time" if you set it close to real time), wouldn't RND(0) outside the loop and RND(1) inside the loop start you with a variety of starting spots based on where the low order integer of the system timer is when that is read for the RND(0) seed?
AFAIR, the problem with calling RND(0) repeatedly is the timer seed only has a range of 0-59. So it's better used to initialize the pseudo-random number generator and then read down the sequence by calling RND with a positive seed.
Since RND(0) reseeds every time and RND(1) moves 1 step down the pseudorandom number sequence, the idea of a "RND(I) ... RND(1)" pattern versus the "RND(1) ... RND(1)" pattern is that if you happen to land at the same spot in the pseudo-random number sequence but in a different iteration of the loop, that part of the pattern won't repeat.