def rule_quadrant_col_and_row_elim_possible(board: Board) -> List[Action]: action_arr = [] max_val = board.max_val() max_sqrt = board.max_sqrt() for quadrant_x in range(0, max_val, max_sqrt): for quadrant_y in range(0, max_val, max_sqrt): quadrant_cells = board.quadrant_cells(quadrant_x, quadrant_y, True) if len(quadrant_cells) == 0: continue for col_y in range(quadrant_y, quadrant_y + max_sqrt): col_cells = board.col_cells(col_y, True) if len(col_cells) == 0: continue action_arr.extend(_quadrant_col_cell_elim_helper(quadrant_cells, col_cells)) for row_x in range(quadrant_x, quadrant_x + max_sqrt): row_cells = board.row_cells(row_x, True) if len(row_cells) == 0: continue action_arr.extend(_quadrant_col_cell_elim_helper(quadrant_cells, row_cells)) return action_arr
def rule_col_exclusive(board: Board) -> List[Action]: action_arr = [] for y in range(board.max_val()): cur_col = board.col_cells(y, True) action_arr.extend(_rule_exclusive_set(cur_col)) return action_arr
def combination_exclusive_rowcol_rule(board: Board) -> List[Action]: action_arr = [] for x in range(board.max_val()): cur_row = board.row_cells(x, True) action_arr.extend(_combination_exclusive_rule_helper(cur_row)) for y in range(board.max_val()): cur_col = board.col_cells(y, True) action_arr.extend(_combination_exclusive_rule_helper(cur_col)) return action_arr