def solve_fn(fn): puzzle = build_sudoku(fn) soln = puzzle.solve() if soln: for row in soln: print row else: print "Fail!"
def testFailureForUnsolveable(self): """Shouldn't return a true value for an unsolvable board.""" puzzle = build_sudoku("testcases/fail") soln = puzzle.solve() assert not soln
def testNearWorstCase(self): """Test a supposedly-hard problem for sudoku solvers""" puzzle = build_sudoku("testcases/near-worst-case") soln = puzzle.solve() assert soln