我想this was wrong try again!
當我選擇的板之外的值打印時的輸入值不是在電路板上,但以某種方式,印刷消息,而不是展現出來,在代碼中斷。插入錯誤的消息,而列表索引超出範圍
def legalMove(self):
if self.board[startX][startY] != False:
def playerMove(self,tile):
if self.legalMove(tile, x, y) == False:
continue
else:
break
else:
print('this was wrong try again!.')
return [x, y]
錯誤
if self.board[startX][startY] != ' ' or not self.isOnBoard(startX, startY): IndexError: list index out of range
在validMove''並拖動[1]:......是'移動[1]'是什麼意思? –
對不起@MrGoldbeere! – Aurum