Пример #1
0
import starter, GUI

board = GUI.get_board()
areas, squares, spaces = starter.start_game(board)

"""
Lower Square and Area take in a space and all the areas, and tell the areas that they've been filled with 
something with a value so they no longer need that value and the value is now impossible for them.

They also let the spaces with values know that everything else is impossible for them.
"""
    
def lower_area(space, areas):
    for area in areas.itervalues():
        if space.value != 0:
            for i in range(9):
                i = i+1
                if i != space.value:
                    space.make_impossible(i)
            if space.row == area.name[-1] or space.column == area.name[-1]:
                area.make_impossible(space.value)
                
def lower_square(space, squares):
    for square in squares.itervalues():
        if space.value != 0:
            for i in range(9):
                i = i+1
                if i != space.value:
                    space.make_impossible(i)
            if space.column in square.columns and space.row in square.rows:
                    square.make_impossible(space.value)