Exemple #1
0
def main_old():

    screen = Screen(600, 600)
    screen.start()
    b = []
    active = True
    tic = TicTacToe()
    tic.start(screen)
    reset_counter = 0
    while (active):

        if (tic.show(screen) == -1):
            tic = TicTacToe()
            tic.start(screen)
            continue
        act = screen.act()
        if (isinstance(act, (list, tuple))):
            if (act[0] >= 0):
                tic.press(act[1])

        if (act == -1):

            active = False
            break
        if (act == 'r' or reset_counter < 0):
            tic = TicTacToe()
            tic.start(screen)
            reset_counter = 0
        if (0 not in tic.values):
            if (reset_counter <= 0):
                reset_counter = 101
            else:
                reset_counter -= 2
    screen.close()