创建一个可以玩井字游戏的AI应用程序。
def board_played (board):
    for i in range (3):
        for j in range (3):
            if board[i][j] != 'X' and board[i][j] != 'O':
                return False

# 进行基本的AI操作来玩井字游戏def play_tic_tac_toe (board):
    # 检查棋盘是否已满
    if board_played (board) == False : 
        # 生成随机位置
        row = random.randint (0,3) 
        col = random.randint (0,3) 
        
        # 检查安全位置
        if (board[row][col] != 'X' and board[row][col] != 'O'): 
            board[row][col] = 'O'
        else: 
            # 再次调用函数
            play_tic_tac_toe (board)
    else: 
        print ("棋盘已满")