randomized version of pacman