move(1,X,Y,_) :- 
	write('Move top disk from '), 
	write(X), 
	write(' to '), 
	write(Y), 
	nl. 
move(N,X,Y,Z) :- 
	N>1, 
	M is N-1, 
	move(M,X,Z,Y), 
	move(1,X,Y,_), 
	move(M,Z,Y,X). 
/*
In operation,  a query is entered in working memory of the form: 
	move(4,left,right,center). 
*/


hanoi(1,Start,End,_) :-
    write('move disc from '),
    write(Start),
    write(' to '),
    write(End),
    nl.

hanoi(N,Start,End,Aux) :-
    N>1,
    M is N-1,
    hanoi(M,Start,Aux,End),
    write('move disc from '),
    write(Start),
    write(' to '),
    write(End),nl,
    hanoi(M,Aux,End,Start).
