Maze walking algorithm. I store the wall info in special data structures.