def solveMaze(win, board):
mazesol.removeDeadEnds(win, board)
I need to call mazesol.removeDeadends(win,board) until it returns 0. This is what the function does:
This function takes the window as its first argument and the board as its second argument. It sweeps the complete board (skipping the first and last rows and the first and last columns), and converts every position that is a path with exactly one path as a neighbor into a dead end. It returns the number of dead ends that were converted.
Is there something wrong with:
while mazesol.removeDeadends(win,board): pass
or
while mazesol.removeDeadends(win,board): print ".",
or
a = 1
while a:
a = mazesol.removeDeadends(win,board)
print "Removed", a
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With