예제 #1
0
 def _make_and_solve_puzzle(self, puzzle_string):
     """
     takes a string makes a puzzle, and clones it
     :return: PuzzleSolver from that cloned puzzle
     """
     puzzle = make_grid_from_string(puzzle_string)
     puzzle_clone = puzzle.clone()
     puzzle_solver = PuzzleSolver(puzzle_clone)
     puzzle_solver.solve()
     return puzzle_solver
예제 #2
0
 def _apply_solve(puzzle_string):
     """
     :return: a tuple containing
              the result of the solve() on the provided string,
              and a repr of the "solved" puzzle
     """
     grid = make_grid_from_string(puzzle_string)
     grid.parse_grid_candidates()
     solver = PuzzleSolver(grid.clone())
     result = solver.solve()
     return result