First the program creates a labyrinth. After that it waits till you click space, then it will find the way to the end.
I just changed the algorithms The new maze drawer algorithm is faster than the other one. The new solver algorithm can start anywhere in the maze and won't break at circles (I added a chance of 1/5 per way to generate some). But the goal has to be next to a wall next to edge (or next to the edge itself). If you want to try a maze forever I made a script for that inside.