New answers tagged

1

You can implement an LCG in BASIC, though it might not be very fast. Here's a small AppleSoft BASIC program that implements an LCG and shows it tested across 10000 simulated dice throws: 10 REM LCG FOR APPLESOFT - SCRUSS, 2021-05 20 REM THIS IS "RANDOM0" - SEE WIKIPEDIA 30 DEF FNS0(S) = 8121 * S + 28411 40 DEF FNS(S) = FNS0(S) - INT (FNS0(S) / ...


2

In Apple Assembly Line Volume 4 Issue 8 Bob Sander-Cederlof documents the RND problems and presents his own smaller version of the original Call APPLE algorithm as a USR function. The RND function in Applesoft is faulty, and many periodicals have loudly proclaimed its faults. "Call APPLE", Jan 83, pages 29-34, tells them in "RND is Fatally ...


7

I found an example that plotted on the hi-res screen to evaluate a replacement RNG. The code is based on a Call-A.P.P.L.E. article from 1989, available here. It appears to be a linear congruential algorithm, but the youtube video shows it's pretty effective. The author tied it to the Applesoft USR function, which makes it very convenient to use. (It ...


5

RND in most 8-bit BASICs is a Linear Congruential PRNG, which has rather spectacularly poor quality output but is exceedingly simple to implement. Generally it will produce a fixed, repeating sequence in which the low-order bits often have an easily recognisable pattern. You cannot merely "fix" a Linear Congruential PRNG to improve the quality of ...


Top 50 recent answers are included