Class and function names
The program is derived from SourGumdrop and I've left as much as I could of that code unchanged in order to help debugging. I'm afraid it may be a bit confusing to outsiders but it is easier for me!
class SGP:
class SGG:
class SGHint:
def __init__(self):
def add(self,score, effects, causes, algorithm):
def list(self):
def delete(self):
def hint_on(self):
def hint_off(self):
def hint_is_on(self):
def restore_hint_mode(self):
def save_hint_mode(self):
def len_hint_effects(self):
def len_hint_causes(self):
def hint_effects(self):
def hint_causes(self):
def mode_ok(self, mode_in):
def mode_is_on(self, mode_in, query_mode):
class SGHistory:
def __init__(self,sg):
def empty(self):
def add(self,sg):
def delete(self):
def get_current(self):
def get_previous(self):
def replace(self,sg):
class BOT:
def __init__(self, sg, hints):
def init_circuit(self):
def do_range(self, sg, cell_index):
def one_move(self, sg, direction):
def turn(self):
def to_next_turn(self, sg):
def one_circuit(self, sg, top_index, hints):
def isolated_necks_1(self, sg, hints):
def get_sum(self, sg):
def topology_1(self, sg):
class SGBGCell:
def __init__(self):
def update(self, candidate, direction):
def highest_prob(self, so_far):
class SGSCell:
def __init__(self, sg, cell_index_in):
def get_next_candidate(self):
class SGCell:
def __init__(self, cell_index):
def print_cell(self, cell_index):
def set_solution(self, solution):
def set_type(self, type):
def set_sum_across_given(self, sum):
def set_sum_down_given(self, sum):
def set_cells_across_given(self, cells):
def set_cells_down_given(self, cells):
def get_cells_across_given(self):
def get_cells_down_given(self):
def set_sum_across(self, sum):
def set_sum_down(self, sum):
def set_cells_across(self, cells):
def set_cells_down(self, cells):
def get_cells_across(self):
def get_cells_down(self):
def get_sum_down_index(self):
def set_sum_down_index(self, index):
def get_sum_across_index(self):
def set_sum_across_index(self, index):
def get_solution(self):
def get_type(self):
def get_sum_across(self):
def get_sum_down(self):
def get_sum_across_given(self):
def get_sum_down_given(self):
def get_guess(self):
def get_candidates(self):
def get_candidate_set(self):
def cell_index_to_ij(self, cell_index):
def ij_to_cell_index(self, i,j):
def get_guess(self):
def candidate_min(self, min_in):
def candidate_max(self, max_in):
def candidate_range(self):
def candidate_is_set(self,candidate):
def guess_is_set(self):
def guess_is_a_given(self):
def guess_correct(self):
def candidates_consistent(self):
def check_range_0_8(self,value):
def check_range_0_9(self,value):
def check_range_1_9(self,value):
def check_range_cell_index(self,value):
def set_solution(self,solution):
def set_guess(self,guess):
def unset_guess(self):
def del_candidate(self,candidate_in):
def add_candidate(self,candidate):
def reset_all_candidates(self):
def get_cell_info(self):
def compare_candidates(self,other):
def available_candidates(self):
class SGSudoku:
def __init__(self):
def set_error_flag(self):
def unset_error_flag(self):
def load_sg_sudoku(self, solutions):
def load_sg_sudoku1(self, puzzle_data):
def next_cell_down(self, cell_index):
def next_cell_across(self, cell_index):
def next_cell_up(self, cell_index):
def next_cell_back(self, cell_index):
def get_sum_across(self, cell_index):
def get_sum_down(self, cell_index):
def get_cells_across(self, cell_index):
def get_cells_down(self, cell_index):
def do_sum_indexes(self):
def do_sums_across(self, cell_index):
def do_sums_down(self, cell_index):
def do_sums(self):
def update_sums(self):
def do_cells_across(self, cell_index):
def do_cells_down(self, cell_index):
def do_cells(self):
def sum_left(self, direction, cell_index):
def update_sums_1(self, direction):
def total(self, elements, length):
def inc(self, elements, length):
def inite(self, length):
def get_range(self, length):
def get_combinations_set(self, combinations):
def overlap3(self,e1,e2):
def cfm(self,s1,s2):
def overlap2(self,e1,e2):
def cf(self,s1,s2):
def get_unique_candidates(self, s1):
def make_dic(self):
def combination_count(self, s):
def combination_set(self, s):
def combination_list(self, s):
def unique_candidates(self, s):
def obligatory_candidates(self, s):
def get_possible_sums(self, cells, minc, maxc):
def algorithms_not_ready(self):
def prepare_to_get_hidden_1(self, direction):
def prepare_to_get_hidden(self):
def get_effects_1(self, cell_index, candidate_list):
def get_cause_1(self, cell_index, candidate_list):
def hp3(self,cell_list,candidate):
def hp2(self, direction, hints):
def hidden_pairs(self,hints):
def ht2(self, direction, hints):
def hidden_triples(self,hints):
def prepare_to_get_naked_1(self, direction):
def prepare_to_get_naked(self):
def naked_1(self, cell_list_1, cell_list_2, candidate_list):
def naked_2(self, cell_list, candidate_list):
def naked_pairs_1(self, cell_list_in, good_stuff, hints):
def naked_pairs(self,hints):
def naked_triples_1(self, cell_list_in, good_stuff, hints):
def naked_triples(self,hints):
def naked_quads_1(self, cell_list_in, good_stuff, hints):
def naked_quads(self,hints):
def xwing_7(self, cell_index, depth, direction):
def xwing_3(self, cell_index, direction):
def xwing_2(self, cell_list, candidate):
def xwing_8(self, candidate, cell_lists, sum_list, lists_index, direction):
def xwing_0(self, candidate, cell_lists, sum_list, lists_index, direction):
def xwing_4(self, cell_index_1, cell_index_2, cell_index_3, cell_index_4, cell_list, candidate):
def sum_list_index(self, cell_index, sum_list):
def xwing_1(self, direction, hints):
def xwing(self, hints):
def hidden_single(self, hints):
def hsr_hsc(self, hints, direction):
def locked_candidate_2(self, hints):
def simple_filter_exhaustively(self, hints):
def simple_filter(self, hints):
def pcr_pcc(self, hints, do_it_now, alg, direction):
def simple_filter_old(self, hints):
def sfr_sfc(self, hints, do_it_now, alg, direction):
def jellyfish(self, hints):
def update_perm_indexes(self, my_list, list_item, list_item_index):
def get_perms(self, my_list, p):
def remove_duplicates(self, p):
def remove_wrong_sum(self, p, sum):
def remove_unique_digits(self, p):
def analyse_perms(self, cands, sum):
def ppr_ppc(self, hints, direction):
def analyse_perms_2(self, cands, sum):
def best_guess_1(self, hints, bg_cells, direction):
def make_bg_cells(self):
def best_guess(self, hints):
def get_sum_range(self, p):
def analyse_perms_1(self, cands):
def candidate_bounds_1(self, hints, direction):
def isolated_necks(self, hints):
def candidate_bounds(self, hints):
def locked_candidate_1(self, hints):
def icc_icr(self, hints, direction):
def swordfish(self, hints):
def ucr_ucc(self, hints, direction):
def print_sg_sudoku(self):
def __len__(self):
def check_range(self,value):
def print_sg_sudoku1(self):
def print_sg_sudoku3(self):
def print_sg_sudoku2(self):
def get_info(self):
def set_solutions(self,job):
def check_strip_1(self, cell_list):
def check_strip_2(self, cell_list, sum):
def check_3(self):
def check_guesses(self):
def is_consistent_1(self, cell_lists):
def is_consistent_2(self, cell_lists, direction):
def is_consistent(self):
def zero_algorithm_usage(self):
def apply_effects(self, hints):
def apply_an_algorithm(self, algorithm, skip, guessing_allowed):
def try_all_algorithms(self):
def apply_all_algorithms(self):
def simplest_first(self):
def simplest_first_only(self):
def new_cell_index(self):
def solve_puzzle(self, pv):
def solve_sg_sudoku(self):
def c_range(self, sum_across, cells_across, sum_down, cells_down):
def unique_solution(self):
def difficulty_rating(self):
class SGWidgetData:
def __init__(self):
class SGWG:
class SGHandleStatus:
def __init__(self):
def redraw_all(self):
def update_all(self):
def this_status(self, status_array_code):
def mode_ok(self, mode_in):
def add_mode_1(self, mode_in, new_mode):
def del_mode_1(self, mode_in, new_mode):
def mode_is_on_1(self, current_mode, mode):
def set_mode(self, mode, status_index, status_array_code):
def add_mode(self, mode, status_index, status_array_code):
def del_mode(self, mode, status_index, status_array_code):
def mode_is_on(self, mode, status_index, status_array_code):
def mode_is(self, mode, status_index, status_array_code):
def toggle_mode(self, mode, status_index, status_array_code):
class SGWidget(Frame):
def __init__(self, parent=None): # attach to top-level?
Frame.__init__(self, parent) # do superclass init
def make_grid_down(self, sg):
def init_fonts(self):
def load_preferences(self):
def SGWidget_sanity_check(self):
def editMenu(self):
def sync_sg_and_sgw(self, new_sg, old_sg):
def check_user_colourings(self, sg):
def serviceEditmenu_toolbar(self, button_index, mouse_button):
def check_toolbar_status(self):
def do_toolbar(self):
def undo_so_colours_off(self):
def hints_are_used_up(self):
def uncolour_hints_1(self, hints, mode_off):
def uncolour_hints(self):
def undo_1(self):
def undo(self):
def service_an_algorithm(self, button):
def service_a_hint_request(self):
def makeMenuBar(self):
def fileMenu(self):
def serviceFilemenu(self,menu_index):
def set_menu_states(self, current_state, choices):
def quit(self):
def do_get_puzzle_from_file(self):
def do_get_puzzle_from_widget(self):
def do_show_solution(self):
def refresh_widgets(self):
def set_hint_level(self, hint_index):
def set_help_level(self, help_index):
def set_algorithm_choice(self, algorithm_index):
def set_algorithm_choice(self, algorithm_index):
def service_help_status(self):
def set_candidate_colour(self, colour_index):
def set_cell_colour(self, colour_index):
def colour_candidates(self, candidate):
def candidate_colours_none(self):
def colour_cell(self,cell_index):
def cell_colours_none(self):
def do_select_puzzle(self):
def makeToolbar(self):
def toolbar_button_handler(event, self=self, button=toolbar_index):
def toolbar_button_handler(event, self=self, button=toolbar_index):
def toolbar_button_handler(event, self=self, button=toolbar_index):
def updateToolbar(self):
def init_for_new_puzzle(self):
def makeCounterbar(self):
def updateCounter(self):
def use_hints(self,sg,hints):
def make_SGCellWidget(self, sg, cell_index):
def little_button_handler(event, self=self, button=button,\
def reset_button_handler(event, self=self, cell_index=cell_index):
def update_SGCellWidget(self,sg, cell_index):
def little_button_despatcher (self, event, button_index, cell_index):
def toggle_little_button (self, cell_index, button_index):
def set_guess_to_candidate (self, cell_index, button_index):
def reset_button_despatcher (self, event, cell_index):
def service_big_button(self, cell_index, menu_index):
def make_SGGridWidget(self,sg):
def update_SGGridWidget(self,sg):
def do_show_difficulty(self):
def do_configure(self):
class SelectPuzzle(Toplevel):
def __init__(self):
def handleList(event,self=self):
class ShowDifficulty(Toplevel):
def __init__(self):
def get_algorithm_usage(self):
def set_score(self, score, alg):
class ConfigureSG(Toplevel):
def __init__(self, sg_widget):
def button_handler(event, self=self):
def button_handlerd(event, self=self):
def button_handlers(event, self=self):
def set_value(self,value,button):
def set_relief_value(self,value,button):
def set_colour_object(self,button):
def configure_configure(self):
def load_defaults(self, sg):
def apply_configure(self, sg):
def load_widgets(self):
def unload_widgets(self):
def do_colours(self,colour_frame):
def handler(event,self=self,i=i):
def handler1(self,event,i):
def set_my_colours(self):
def save_settings(self):
class SGIO:
def __init__(self):
def check_puzzle_values(self):
def sg_open_file(self):
def get_data_from_file(self, my_file):
def flip(self,my_str):
def parse_1(self, lines):
def pv_to_cells(self):
def parse_2(self):
def parse_data(self, lines):
def read_puzzle(self, my_file):
def write_puzzle(self):
class EnterPuzzle(Toplevel):
def __init__(self):
def get_data(self):
def make_lines(self, content):




