Hello everybody.
I'm currently using Kernal's ENTROPY_GET routine to shuffle a 5 elements array, but I get some quirks:
- a certain sequence shows up way too often
- occasionally a sequence comes up twice in a row
Upon extensive checking, I can safely claim that my shuffle algorithm is working properly, so I'm now questioning if ENTROPY_GET is a reliable random number generator.
Did any of you have a chance to deal with such routine? What do you think about it?
Thanks,
Giacomo
ENTROPY_GET
Re: ENTROPY_GET
JAT, is there a way to initialize the seed before calling the routine, like you can in BASIC?
- desertfish
- Posts: 1123
- Joined: Tue Aug 25, 2020 8:27 pm
- Location: Netherlands
Re: ENTROPY_GET
I don't think there's a way to "seed" this, actually, I would argue the result of this call is meant to be a seed in its own.
The docs say:
Here's a pretty good prng https://codebase64.org/doku.php?id=base ... r_8_16_bit
The docs say:
So it's probably best to do that, and not continuously call this routine to get random numbers from.This routine returns 24 somewhat random bits in registers .A, .X, and .Y. In order to get higher-quality random numbers, this data should be fed into a pseudo-random number generator.
Here's a pretty good prng https://codebase64.org/doku.php?id=base ... r_8_16_bit