I've been working on this python program for a while and I need some help please. This program consists of classes and functions to make a basic maze. I'm not using Tkinter or any gui's. Just a printout where python does all the calculating. I have three files, main.py, maze.py, and path.py. User inputs dimensions...then follow the menu. I can print the maze, when I try to solve it, the program prints an endless loop of errors. Can you help fix it because I can't find it.
This is the code where I can't 'solve' the maze, bc python would be reading these functions. (i think)
def findPath(self): # start the recursion return self.rfindPath(self.start,self.start) def rfindPath(self,i,j): if(i < 0 or i > self.m or j < 0 or j > self.n): return False elif(self.theMaze[i][j] == ' X' or self.theMaze[i][j] ==' v' or self.theMaze[i][j] == ' *'): if(self.theMaze[i][j] == ' *'): self.theMaze[i][j] == ' v' self.thePath.pop() return False def removeVs(self): for i in range(0, self.m): for j in range(0, self.n): if self.theMaze[i][j] == ' v': self.theMaze[i][j] = ' O' return
the attachments are .txt. rename them to .py, save them in the same folder together, and run main.py to try it out.
THANK YOU FOR YOUR HELP! :)