Be aware that as guest, programs you create could be edited or deleted by anyone. Register
loc = right;middle;left.
hanoi(integer).
move(integer,loc,loc,loc).
inform(loc,loc).
hanoi(N):-
move(N,left,middle,right).
move(1,A,_,C):-
inform(A,C),!.
move(N,A,B,C):-
N1=N-1, move(N1,A,C,B),
inform(A,C),move(N1,B,A,C).
inform(Loc1, Loc2):-nl,
write("Move a disk from ", Loc1, " to ", Loc2).
hanoi(3).