Question: help me fix it . we do not allowed to move aux 3 direct to aux 2 V = ( Start , Al , A

help me fix it. we do not allowed to move aux3 direct to aux2
V=(Start, Al, A2, A3, Dest} and
E ={(Start, Dest),(Dest, Al),(Al.Dest),(Al,A2),(A2,A3),(A3,AI).
total_moves =0
def move (n,s,t):
global total_moves
total_moves }\overline{\mp}=
print(f"{total_moves): Move {n} from {s} to (t).")
def MoveFoward(n,start, target, aux1, aux2, aux3):
if (n==1):
move (n,start, target)
move (n,target, auxl)
move (n, aux1,aux2)
move (n,aux2,aux3)
if (n>=2):
MoveFoward(n-1, start, target, aux1, aux2, aux3)
move (n,start, target)
move (n,target, aux1)
move (n, aux1,aux2)
MoveBackward (n-1, aux3, aux2, aux1, target)
move (n, aux2, aux3)
MoveBackward(n-1,target, aux1,aux2,aux3)
def MoveBackward (n, aux3, aux2, aux1, target):
if (n==1):
move (n, aux3, aux2)
move (n, aux2, aux1)
move (n, aux1, target)
if (n>=2):
MoveBackward(n-1,aux3, aux2, aux1, target)
move (n,aux3, aux2)
move (n,aux2,aux1)
MoveBackward(n-1, target, aux1, aux2, aux3)
move (n, aux1, target)
MoveBackward(n-1,aux3, aux2, aux1, target)
def HanoiMain (n, start, target,aux1,aux2,aux3):
if (n==1)
move (n, start, target)
if (n>=2):
MoveFoward(n-1,start, target, aux1,aux2,aux3)
move (n,start, target)
MoveBackward(n-1, aux3, aux2, aux1, target)
Number_of_pegs = int(input('What is the number of disk: '))
HanoiMin(Number_of_pegs,'start','dest','al','a2','a3')
help me fix it . we do not allowed to move aux 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!