Remix.run Logo
themafia 2 hours ago

Well that opened a bit of a rabbit hole. Looking at the source code I saw this which made me chuckle:

    RNUMBER  DC    F'16807'            RANDOM NUMBER.
Surely we wouldn't have DailyWTF quality code here. Looking for how it's referenced we find the RANDOM function itself:

    *        RANDOM NUMBER GENERATOR.
    *        LEHMER'S METHOD, CACM JUNE '66, P 432.
    *        N(I+1) = P RES Q X N(I)
    *        P = (2**31)-1
    *        Q = 7**5
Following that lead to the original ACM article referenced:

https://dl.acm.org/doi/epdf/10.1145/365696.365712

Which further lead to this rather interesting article on the history of the ROLL function which relies on this random number generator:

https://www.jsoftware.com/papers/roll.htm

Neat!