Esempio n. 1
0
def solve_singles(board, pboard):
    lone = look_for_lone_ptable_entries(pboard)
    if lone[0]:
        for value in lone[1]:
            msg = "possibility table at " + str(cflip(value[0])) + " has only a single entry which is the number " + str(value[1])
            support.update_gamestepslog("board", "add", value[0], value[1], msg, True)
            support.oo_update_actions(value[0], value[1], board, pboard)
        return True
    return False
Esempio n. 2
0
def solve_single_possible(board, pboard):
    placed = False
    type_x_lookup = {0:"row", 1:"column", 2:"square"}
    possible = look_for_single_poss_numbers(pboard)
    if possible[0]:
        for value in possible[1]:
            msg = "the number " + str(value[1]) + " showed up only once in the possibility table for its " + str(type_x_lookup[value[2]])
            support.update_gamestepslog(b_type="board", func="add", coord=value[0], num=value[1], msg=msg, step_up=True)
            support.oo_update_actions(value[0], value[1], board, pboard)
        placed = True
    return placed
Esempio n. 3
0
def solve_singles(board, pboard):
    lone = look_for_lone_ptable_entries(pboard)
    if lone[0]:
        for value in lone[1]:
            msg = "possibility table at " + str(
                cflip(value[0])
            ) + " has only a single entry which is the number " + str(value[1])
            support.update_gamestepslog("board", "add", value[0], value[1],
                                        msg, True)
            support.oo_update_actions(value[0], value[1], board, pboard)
        return True
    return False