Based on the original ghost AI from the Pac-Man arcade.
Pac-Man wants fruit, but is aghast in the face of ghosts. Press "1" to allow your ghost to step forward. (Pac-Man will wait for his turn to move.)
Let's lock our ghost up to study Pac-Man's behavior first.
Even though Pac-Man wants his fruit, he can't turn back and is forced to take the long way. Your ghost suffers the same, but both can turn around if at a dead-end.
Press "1" to cycle your turn to see Pac-Man move.
Pac-Man follows his nose, but unfortunately he can smell the fruit through the walls. So, he'll take a wrong turn if it smells better than the others.
Remember he can't turn back, unless at a dead end!
Press "1" to see him eventually get there. Press "Z" to rewind.
Pac-Man doesn't flip coins, so when he can't decide which turn smells better, he chooses in the following clockwise order: UP, RIGHT, DOWN, LEFT.
Press "1" to see him favor the RIGHT turn.
Meet Blinky, your first ghost. He behaves exactly like Pac-Man, except he prefers fruit of the Pac-Man variety :)
Press "1" to cycle Blinky until he inevitably catches Pac-Man.
Here you can see that Blinky has no hope of catching Pac-Man here. His behavior simply won't allow him to.
Press "1" to cycle to the inevitable defeat.
Meet Pinky, your second ghost! You'll now have a choice of which ghost to move on each turn.
Press "2" to move Pinky, or "1" to move Blinky.
Pinky actually doesn't chase Pac-Man like Blinky does. Instead, he tries to get ahead of him by aiming three tiles ahead of where Pac-Man is looking. This doesn't always work out, as you can see here...
Press "2" to move Pinky.
Though neither of them can catch Pac-Man on their own here, Pinky and Blinky can accomplish a lot if you make them work together.
Press "1" to move Blinky, or "2" to move Pinky.
Meet your third ghost, Clyde! He chases Pac-Man directly, but unlike Blinky, he gets scared when he's too close and tries to make off in the opposite direction.
Press "3" to see Clyde choke.
Clyde, like the others, cannot turn back to reach his target, so he is known to accidentally run into Pac-Man if he can't get away in time.
Press "3" to move the unstoppable Clyde.
All of them