First the program creates a labyrinth. After that it waites till you click space. Now it will find the way to the end.
I read in a book that you have always to walk with your left hand on the wall in a labyrinth furthermore you are going to reach the end. For this reason I thought it would be easy to program a pathfinder for a labyrinth.