Ханойская башня


--- solution.py
  • solution.py
def moveTower(height,fromPole, toPole, withPole):
    if height >= 1:
        moveTower(height-1,fromPole,withPole,toPole)
        moveDisk(fromPole,toPole)
        moveTower(height-1,withPole,toPole,fromPole)

def moveDisk(fp,tp):
    print("Переместить диск со стержня",fp,"на",tp)

moveTower(3,"A","B","C")
© RemiZOffAlex