Anytime Pac-Man eats one of the four energizers on the level, the ghosts reverse direction and, on earlier levels, go into frightened mode. Frightened ghosts turn dark blue and wander about the maze for a few moments, flashing briefly as a warning before returning to normal. Ghosts use a pseudo-random number generator (PRNG) to pick a way to turn at each intersection when frightened. The PRNG generates an pseudo-random memory address to read the last few bits from. These bits are translated into the direction a frightened ghost must first try. If a wall blocks the chosen direction, the ghost then attempts the remaining directions in this order: up, left, down, and right, until a passable direction is found. The PRNG gets reset with an identical seed value every new level and every new life, causing predictable results. This is why the frightened ghosts' movements are repeatable in the context of a memorized pattern or sequence. As the levels progress, the time ghosts spend in frightened mode grows shorter until eventually they no longer turn blue at all (they still reverse direction). Refer to Table A.1 in the appendices for the frightened time in seconds and number of flashes, per level.