From e512dc0b9c8a573ef2075185b3221c8d9d21c14c Mon Sep 17 00:00:00 2001 From: Stephen McQuay Date: Wed, 31 Oct 2012 23:12:27 -0700 Subject: [PATCH] shouldn't have used an optional param --- bin/solve_maze.py | 2 ++ maze/__init__.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/solve_maze.py b/bin/solve_maze.py index ccb8957..8811755 100644 --- a/bin/solve_maze.py +++ b/bin/solve_maze.py @@ -2,8 +2,10 @@ import sys from maze import parse_maze + if len(sys.argv) == 2: m = parse_maze(open(sys.argv[1], 'r').read()) else: m = parse_maze(sys.stdin.read()) +sys.setrecursionlimit(m._size * 1000) print m.solve() diff --git a/maze/__init__.py b/maze/__init__.py index bf05e8c..fff42bc 100644 --- a/maze/__init__.py +++ b/maze/__init__.py @@ -12,7 +12,7 @@ class CS235Maze(object): self._data = 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 \ x >= self._size or y >= self._size or z >= self._size: return False