A259233 Random number table used by Doom.
0, 8, 109, 220, 222, 241, 149, 107, 75, 248, 254, 140, 16, 66, 74, 21, 211, 47, 80, 242, 154, 27, 205, 128, 161, 89, 77, 36, 95, 110, 85, 48, 212, 140, 211, 249, 22, 79, 200, 50, 28, 188, 52, 140, 202, 120, 68, 145, 62, 70, 184, 190, 91, 197, 152, 224, 149
Offset: 0
Links
- J. Hufford, Table of n, a(n) for n = 0..255
- GitHub, Source
- The Doom Wiki, Pseudorandom number generator
- Video Game Preservation, Table in the source code to "Commander Keen in Keen Dreams"
- Video Game Preservation, Table in the source code to "Rise of the Triad"
- Index entries for sequences related to pseudo-random numbers.
Programs
-
Python
state = 1 for _ in range(256): print(state >> 16, end=', ') state = (134775813 * state + 1) % (1 << 24) # Simon Howard, Nov 01 2024
Formula
a(n) = floor((134775813^(n+1) - 1) / 8832667615232) mod 2^8 (by sum of a geometric series). - Simon Howard, Nov 04 2024
Comments