我已經開始製作一個小遊戲。我創建了一個函數來打破它後面的所有代碼。下面是完整的功能:函數打破所有後來的代碼
def printBoard(currentBoard):
#Prints out the game board
for x in range(5):
#prints out 50 character line x
print (' '.join(str(currentBoard[x*50:(x+1)*50]))
儘管它仍然只用這個作品:
def printBoard(currentBoard):
print (' '.join(str(currentBoard[x*50:(x+1)*50]))
即使之類的東西:
print("Hello")
之後不會發揮作用。我試着切換變量名稱等,但錯誤仍然存在。
所有的代碼在'printBoard'功能應縮進一個級別。 – Alexander
你應該真的給我們回溯你所看到的例外。沒有這個,我們只能猜測出現了什麼樣的錯誤以及它發生了什麼。 – Blckknght