hanoi(N):- move(N,torreA,torreB,torreC).

move(1,A,B,_):- 
	write('Move o disco da '),
	write(A),
	write(' para '),
	write(B),
	nl.
	
move(N,A,B,C):-
	N>1,
	N1 is N-1,
	move(N1,A,C,B),
	move(1,A,B,_),
	move(N1,C,B,A).
