def test() -> None: # For testing this class on its own, without needing OuterSolver locations = Clues.get_locations_from_grid(GRID) clue_list = Clues.create_from_text(ACROSS, DOWN, locations) solution = { 'H': 1, 'E': 2, 'S': 3, 'N': 4, 'I': 5, 'G': 6, 'L': 7, 'R': 8, 'T': 9, 'D': 10, 'A': 11, } letter_values = { Letter(letter): value for letter, value in solution.items() } # Evaluate each of the clues clue_values = { clue: clue.evaluators[0](letter_values) for clue in clue_list } solver = InnerSolver(clue_list, clue_values, letter_values) solver.solve(debug=False)
def run() -> None: locations = Clues.get_locations_from_grid(LOCATIONS) clue_list = Clues.create_from_text(ACROSS, DOWN, locations) solver = EquationSolver(clue_list, items=tuple(range(1, 17)), allow_duplicates=True) solver.verify_is_four_fold_symmetric() solver.solve()
def run() -> None: locations = Clues.get_locations_from_grid(GRID) clue_list = Clues.create_from_text(ACROSS, DOWN, locations) solver = OuterSolver(clue_list, items=range(1, 12)) solver.verify_is_180_symmetric() solver.solve()
def make_clue_list(self) -> Sequence[Clue]: locations = Clues.get_locations_from_grid(GRID) return Clues.create_from_text(ACROSS, DOWN, locations)
def run() -> None: grid = Clues.get_locations_from_grid(GRID) clues = Clues.create_from_text(ACROSS, DOWN, grid) solver = OuterSolver(clues) solver.solve()
def run() -> None: locations = Clues.get_locations_from_grid(GRID) clue_list = Clues.create_from_text(ACROSS, DOWN, locations) solver = MySolver(clue_list, items=(2, 3, 5, 7, 11, 13, 4, 9, 25, 49, 121, 169)) solver.verify_is_180_symmetric() solver.solve(debug=False)