Template:PRNG
Jump to navigation
Jump to search
Template documentation
A simple linear congruential generator for generating bad random numbers using the parameters "X_{n+1}=(16843009 X_n + 826366247) mod 4,294,967,296 + 1" (the values from cc65's rand).
- arg1 - input
- arg2 - mod (optional)
| Case | Result |
|---|---|
{{PRNG|1}}, {{PRNG|2}}, {{PRNG|3}}, {{PRNG|4}}, {{PRNG|5}}
|
843209257, 860052266, 876895275, 893738284, 910581293 |
{{PRNG|1|2}}, {{PRNG|2|2}}, {{PRNG|3|2}}, {{PRNG|4|2}}, {{PRNG|5|2}}
|
1, 2, 1, 2, 1 |
{{PRNG|{{PRNG|1}}}}, {{PRNG|{{PRNG|2}}}}, {{PRNG|{{PRNG|3}}}}
{{PRNG|{{PRNG|1}}|5}}, {{PRNG|{{PRNG|2}}|5}}, {{PRNG|{{PRNG|3}}|5}}
|
688315473, 755621457, 822927445
1, 1, 5 |
{{PRNG|{{PRNG|{{PRNG|1}}}}}}, {{PRNG|{{PRNG|{{PRNG|2}}}}}}, {{PRNG|{{PRNG|{{PRNG|3}}}}}}
{{PRNG|{{PRNG|{{PRNG|1}}}}|5}}, {{PRNG|{{PRNG|{{PRNG|2}}}}|5}}, {{PRNG|{{PRNG|{{PRNG|3}}}}|5}}
|
2390066809, 2541389945, 2760085117
5, 1, 3 |