So I'm trying write a program that will solve any maze using a recursive function. I keep coming close to solving it using a random number generator that tells the program where to move next if there is more than one possible move surrounding the space it is currently at.
My problem is that the program only runs a certain number of times and then gives me an error. So it never reaches the end of the maze. I have a base case for when it reaches the mark that denotes the end of the maze and I also have a function which will back track over spaces already visited if it gets into a space where it no longer has any possible moves. I have been working on this FOREVER and am incredibly frustrated. I've heard that this is because I have too many variables which will overload the stack but I don't know how to reduce the number of variables I feel like I need them all!!!!!!!!!!! Ahh!!!!!!