13
edits
mNo edit summary |
(you need to do a bitwise xor, not a boolean xor. Also, the final value must be less than eight.) |
||
Line 104: | Line 104: | ||
Whether a Pokémon is [[alternate coloration|shiny]] or not depends on the values of the [[Trainer ID number]], [[secret ID number]], and personality value. | Whether a Pokémon is [[alternate coloration|shiny]] or not depends on the values of the [[Trainer ID number]], [[secret ID number]], and personality value. | ||
Variables ''E'' and ''F'' are declared to hold the values that result. | |||
A bitwise {{wp|exclusive or}} (''xor'') operation (such as ''a'' xor ''b'' = ''c'') is equivalent to saying "If each byte of ''a'' ≠ ''b'', ''c'' is true." In other words, 11010101 xor 01101010 = 10111101 . Each xor in the operation is a bitwise xor. | |||
''E'' = ''ID<sub>Trainer</sub>'' xor ''ID<sub>Secret</sub>'' | ''E'' = ''ID<sub>Trainer</sub>'' xor ''ID<sub>Secret</sub>'' | ||
''F'' = ''p<sub>1</sub>'' xor ''p<sub>2</sub>'' | ''F'' = ''p<sub>1</sub>'' xor ''p<sub>2</sub>'' | ||
'' | ''E'' xor ''F'' <= 8 , then ''Shiny'' | ||
==Spinda's spots== | ==Spinda's spots== |
edits