Pokemon R/B/Y - Level 1 / 171 Psywave infinite loop
In the first generation, Psywave deals damage equal to a number randomly generated between 1 and aproximately 1'5 * attacker's level.
When Psywave is used, the game generates a random 1-byte number (between 0 and 255) and loops until the number generated follows these two conditions:
- It's not 0, if it's the player turn
- It's lower than [attacker's level + attacker's level/2], rounded down.
If the level is 1, the 0 number is ignored as a result of the first condition and all the remaining numbers are ignored as a result of the second condition, causing the game to loop indefinitely hopelessly searching for a number it can't find.
If the level is 171, the sum 171 + 171/2 gives out a result of exactly 256; since it has to fit in one byte, 256 rolls over to 0... meaning that the non-0 condition alone causes the infinite loop.