Closed hiavatch closed 3 years ago
That's fairly possible as currently nothing guarantees that the random number generator will return all possible values, even if you call RND()
many times.
For your reference, XC=BASIC uses this RND routine: https://codebase64.org/doku.php?id=base:16bit_pseudo_random_generator
Seeding the randomizer could still be improved but I'm afraid that it will not solve the above problem.
(Note: the RND()
function is going to be entirely rewritten in version 3.)
Thanks for the response. I'll code around it until the update. Great project, btw.
Some numbers are not selected, sometimes. One test never selected a 2, with 5000 consecutive calls. Another never produced a 1, or a 45, even with 30000 consecutive calls. Yet another test selected all three of these at least once--all with the same test code:
I noticed this when playing with a crude demo to fill the screen really fast with random characters: some character locations remained blank while others changed very often. The above test code was my attempt to figure out what went wrong.