def hanoi(N,base,asist,destination):
if N==1:
#move(1,base,destination)
print('Move disk from {} to {}'.format(base, destination) )
else:
hanoi(N-1,base,destination,asist)
#move(1,base,destination)
print('Move disk from {} to {}'.format(base, destination) )
hanoi(N-1,asist,base,destination)
网友评论