RNG: Difference between revisions

Jump to navigation Jump to search
130 bytes removed ,  16 April
m
lol
No edit summary
m (lol)
Line 124: Line 124:
===Properties===
===Properties===
[[File:RNG Graph.png|500px|thumb|A graph showing notable RNG values and indices in SM64.]]
[[File:RNG Graph.png|500px|thumb|A graph showing notable RNG values and indices in SM64.]]
The RNG function has 65536 possible inputs and 65536 possible outputs. It is a [[wikipedia:Bijection|bijection]], meaning that every input maps to exactly one output, and none repeat or are left out.
The RNG function has 65536 possible inputs and 65536 possible outputs. The function forms two loops, one of length 65534 and one of length 2, but one of the [[wikipedia:If statement|if statements]] causes the cycle of 2 to lead back to the cycle of 65534.
 
The function forms two loops, one of length 65534 and one of length 2, but one of the [[wikipedia:If statement|if statements]] causes the cycle of 2 to lead back to the cycle of 65534.


Oddly, the RNG value of 21674 at index 65113 loops back to index 0. This may be because this index's S1 value is equal to the previous RNG value for the first time, but that is no reason to prematurely end the loop.
Oddly, the RNG value of 21674 at index 65113 loops back to index 0. This may be because this index's S1 value is equal to the previous RNG value for the first time, but that is no reason to prematurely end the loop.

Navigation menu