A javascript exercise. Pacman AI.