Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Help sovle for ERROR MESSAGE: in main q.mazeSolve(node, maze, startRow, startColumn) AttributeError: 'LinkedQueue' object has no attribute 'mazeSolve' def mazeSolve(self, node, q, maze, startRow, startColumn):
Help sovle for ERROR MESSAGE: in main q.mazeSolve(node, maze, startRow, startColumn) AttributeError: 'LinkedQueue' object has no attribute 'mazeSolve' def mazeSolve(self, node, q, maze, startRow, startColumn): node.self = node q.self = q maze.self = maze startRow.self = startColumn startColumn.self = startColumn if node != None: print("Maze has solved:") path = q path.enqueue(node.data) node = node.next while (node != None): (i, j) = node.data path.enqueue((i, j)) maze[i][j] = '0' node = node.next n = 0 print("Length of the path: ", path.__len__()) # method s = " " while not path.isEmpty(): s += str(path.dequeue()) n += 1 if n % 10 == 0: s = s + " " s = s.rstrip(", ") maze[startRow][startColumn] = 'P' print(str(maze)) print(s) else: print("Maze has no solved: ") print('-----------------------------------------------') def main(): maze = getMazeGridFromFile() print("Find the path of a maze by using a QUEUE: ") (startRow, startColumn) = findStartPos(maze) node = getPath(startRow, startColumn, maze) q = LinkedQueue() q.mazeSolve(node, maze, startRow, startColumn) main()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started