Task

Solve the   Towers of Hanoi   problem with recursion.




module hanoi;
 
extern printf;
 
@Void move(@Integer n, @Integer from, @Integer to, @Integer via) [
	if (n > 0) {
		move(n - 1, from, via, to);
		printf("Move disk from pole %d to pole %d\n", from, to);
		move(n - 1, via, to, from);
	}
]
 
@Integer main [
	move(4, 1,2,3);
	return 0;
]