它正在将一个棋盘引用到一个有 9 个插槽的游戏,一旦插槽被填满,##while 循环会在没有任何空位并且我不知道如何修复它时继续寻找新位置,请帮助!:(
computer = random.randint(0, 8)
if board[computer] != 'X' and board[computer] != 'O':
print computer
board[computer] = 'O'
else:
while board[computer] == 'O' or 'X':
counter = 0
if counter > 15:
break
computer = random.randint(0, 8)
print computer
if board[computer] != 'X' and board[computer] != 'O':
board[computer] = 'O'
counter += 1