Beispiel #1
0
def press(num):
    '''
    Comando de los botones. Desactiva las posiciones del tablero donde se presento el movimiento.
    :param num: referencia a la posicion del tablero donde se presenta el movimiento.
    :type num: integer
    '''
    global a
    global count
    global first
    button = buttonList[num]
    button.config(text=str(a[count%2]), state=DISABLED)
    AI.posJuego(num, first)
    count+=1
    if first==False and not AI.isOver() and AI.freeSpace():
        first = True
        press(AI.nextMove())
    elif not AI.freeSpace() or AI.isOver():
        colorButton(AI.poswin)
        info.config(text= "Fin Partida! Juego para "+a[(count-1)%2])
        tkMessageBox.showinfo("FIN PARTIDA", message(first, AI.isOver()))
        end()
    else: first = False