我正在做着名的游戏“河内塔”的练习,当我运行我的代码时出现错误。但我不知道如何解决它。这里是我的代码: class HanoiT():
def __init__(self, content=None):
if content is None:
self.content=[]
else:
self.content=content
我正在尝试实施河内塔的递归函数。 的算法是: Move n−1 disks from peg AA to peg C using peg B as intermediate storage.
Move the nth disk from peg A to peg B,
Move n−1 disks from peg C to peg BB using peg A as intermedia