board.py 548 Bytes
Newer Older
Fedrico Otaran's avatar
Fedrico Otaran committed
1
2
import PySimpleGUI as sg

3
4

def build(player_1, player_2, board_data):
Fedrico Otaran's avatar
Fedrico Otaran committed
5
    layout = [
6
7
8
        [sg.Text("Jugador 1: " + player_1["name"], key="-P1-", text_color="darkblue")],
        [sg.Text("Jugador 2: " + player_2["name"], key="-P2-", text_color="white")],
        [sg.Text("")],
Fedrico Otaran's avatar
Fedrico Otaran committed
9
10
11
12
    ]

    for y in range(3):
        layout += [
13
14
15
16
            [
                sg.Button(board_data[x][y], size=(8, 4), key=f"cell-{x}-{y}")
                for x in range(3)
            ]
Fedrico Otaran's avatar
Fedrico Otaran committed
17
18
        ]

19
    board = sg.Window("Ta Te Ti").Layout(layout)
Fedrico Otaran's avatar
Fedrico Otaran committed
20
21

    return board