shouldn't have used an optional param

This commit is contained in:
Stephen McQuay 2012-10-31 23:12:27 -07:00
parent dc10e85274
commit e512dc0b9c
2 changed files with 3 additions and 1 deletions

View File

@ -2,8 +2,10 @@ import sys
from maze import parse_maze from maze import parse_maze
if len(sys.argv) == 2: if len(sys.argv) == 2:
m = parse_maze(open(sys.argv[1], 'r').read()) m = parse_maze(open(sys.argv[1], 'r').read())
else: else:
m = parse_maze(sys.stdin.read()) m = parse_maze(sys.stdin.read())
sys.setrecursionlimit(m._size * 1000)
print m.solve() print m.solve()

View File

@ -12,7 +12,7 @@ class CS235Maze(object):
self._data = data self._data = data
self._size = len(data) self._size = len(data)
def _solve(self, x, y, z, path=None): def _solve(self, x, y, z, path):
if x < 0 or y < 0 or z < 0 or \ if x < 0 or y < 0 or z < 0 or \
x >= self._size or y >= self._size or z >= self._size: x >= self._size or y >= self._size or z >= self._size:
return False return False