plays
ユーザーが function の引数に挿入するすべての文字列を関数内の文字move()
列に保持する関数を書きたいと思いundo_str
ますundo()
。ここで何が欠けていますか?
class Sokoban:
def __init__(self, board):
self.board = board.copy()
def move(self, plays):
............
def undo(self):
undo_str=""
undo_str=undo_str[:]+plays
self.undo=undo_str[:-1]