In Pokémon Red, Blue, and Yellow, there are playable slot machines in the Celadon Game Corner. The rules are apparently simple: The player needs to line up the same symbols on horizontal or diagonal lines (the set of available lines depends on the number of coins betted), and the player can stop the reels, one at a time, using the A button. In reality, the game may cause the reels to "slip" after the A button press either to hinder or to help the player, and the rules for doing so are actually complicated, with many oddities that may or may not be glitches. (Together with the separate building for prize claims, this is comparable to how real life Japanese pachi-slots are played.)
Thanks to the disassembly, the actual behaviors of the slot machines in Generation I are completely understood, although at some places it may still be unclear whether they match the intended behaviors.
For each individual spin, the slot machine can be in one of three modes:
- Mode bad, which guarantees that the player cannot get any match in the available lines.
- Mode good, which allows the player to get matches of symbols other than sevens or bars.
- Mode super, which allows and actively helps the player to get matches of sevens and bars.
- Mode super is the only mode of the three that will persist between spins. It will only end when the player wins a reward of 100 coins (bars) or 300 coins (sevens), and in the latter case only with a probability of 50% (i.e. it still have a 50% chance to persist).
In general, for each spin, the mode is set to mode good or mode super with probability 45/256 (~17.6%), with the probability of mode super further depending on which slot machine the player is playing on (see below). It is set to mode bad with probability 210/256 (~82.0%). There is also a chance of 1/256 (~0.4%) to enter a lucky streak which allows the player to play on mode good (but never mode super) for all the spins after this one, until the player wins 60 times.
The lucky slot machine
Whenever the player enters the Game Corner, a random number between 0 ~ 31 is generated, and if it is 0, it has a 7/8 chance of becoming 1. Then, whenever the player plays on a slot machine, the number is compared with the index of that slot machine (0 ~ 35) plus one. If it matches, the chance of playing in mode super is set to 5/256 (~2.0%), and otherwise it is set to 2/256 (~0.8%).
Effectively, this means that every time the player enters the game corner, there is usually a "lucky slot machine" among the machines with index 0 ~ 30. The lucky slot machine is most likely (15/256, ~5.9%) to be the one with index 0 (the rightmost, bottommost one), and cannot be the ones with index 31 ~ 35 (the bottom five in the leftmost column). The other ones all have a probability of 1/32 (~3.1%) to be lucky, including the ones occupied by an NPC, or otherwise unplayable ("Out of order", "Out to lunch", or "Someone's keys"). Finally, there is a tiny chance (1/256, ~0.4%) that the lucky slot machine is the nonexistent slot machine -1.
The mode of the slot machine comes into play when the player presses the A button to stop a reel, as the reel may "slip" after the A press depending on its position. The exact logic for stopping the reel also depends on which reel the player is stopping. Internally, the first two reels are programmed to slip 4 times unless a condition is met earlier, while the third reel can either slip up to 4 times to help the player get a match, or slip any number of times to prevent a match.
In mode bad or mode good, the condition for the first reel to stop early is that the middle symbol is not a cherry. Since there are no two consecutive cherry symbols (in fact, there are no consecutive same symbols on any reel), that means the first reel will slip at most once.
In mode super, the condition for the first reel to stop early is that any of the three symbols showing is a symbol with an internal value less than that of the seven symbol. Since the seven symbol has the lowest internal value of all symbols, this condition is in fact never satisfied, and the first reel will always slip by 4 positions.
In mode bad or mode good, the condition for the second reel to stop early is that there must be a "potential match" on the first two reels, i.e. two of the same symbols that may form a line if the third reel stops in a good position. The player's bet is not considered; for example, a diagonal potential match counts even if the player only betted 1 or 2 coins.
In mode super, the condition for the second reel to stop early is that the potential match found is of either sevens or bars, or that there is no potential match and the bottom symbol on the second reel is seven or bar.
In mode bad or mode good, the third reel will always slip to prevent a disallowed match, i.e. any match in mode bad, or a match of sevens or bars in mode good. There is no upper limit for the distance the reel has to advance this way; as an extreme example, hacking the game so that the reels contain all sevens will likely cause the game to softlock.
In addition, in mode good or mode super, the reel will slip up to 4 times if no match is found. This is not counting the number of slips done to skip disallowed seven or bar matches in mode good, so the total number of slips may exceed 4.
Notice that, due to the design of the reels, there can never be more than one match at any time.
- On the spin where the player enters the lucky streak, the actual mode stays as it is on the previous spin, which can be either mode bad or mode good (the mode is initialized to mode bad at the beginning of a session). If the mode happens to be mode good and the player wins, it will still count towards the 60 wins to end the lucky streak.
- There is a line of code to immediately end the lucky streak if the player wins a reward of 300 coins, but this seems to be impossible, because the lucky streak is mutually exclusive with mode super, and mode good doesn't allow matches of sevens.
- The probability distribution of the lucky slot machine is weird in multiple aspects. The fact that one machine is more likely to be lucky and some others have no chance might be intended, but the fact that it can be the nonexistent slot machine -1 seems certainly an off-by-one error.
- The fact that the first reel's early stop condition in mode super is never satisfied is most likely a bug. Presumably, the intention is that the reel should stop if a seven symbol is showing, but the developers mistakenly wrote
jr c instead of
- The second reel's early stop condition in mode super is weird in two aspects.
- The "bottom symbol on the second reel" condition seems like an accidental use of leftover variable, although it may also be intended since there are two instructions specifically making it the bottom symbol.
- The "sevens or bars" check is only for the first potential match found, in the order of "bottom-bottom, bottom-middle, middle-middle, top-middle, top-top" (i.e. from bottom to top), which means a potential match of bars may be rerolled if it appears above a potential match of another symbol.
Analysis of how the slot machines in Pokémon Red, Blue, Yellow work by Crystal_: