from minimax import aiO, aiX, Terminal, Value
# from player import player


def display_board(board):
    print('-------------')
    for row in [board[i:i + 3] for i in range(0, 9, 3)]:
        print(f'| {row[0]} | {row[1]} | {row[2]} |')
        print('-------------')

def main():
    results = []
    while True:
        board = [" " for _ in range(9)]
        # board = ['O', 'X', 'O','O', 'X', 'X',' ', ' ', 'X']
        display_board(board)
        while True:
            board[aiX(board)] = "X"
            display_board(board)
            if Terminal(board):
                break
            board[aiO(board)] = "O"
            display_board(board)
            if Terminal(board):
                break
        results.append(Value(board))


if __name__ == '__main__':
    main()
