Task

Solve the   Towers of Hanoi   problem with recursion.




proc move(byte n, src, via, dest) void:
    if n>0 then
        move(n-1, src, dest, via);
        writeln("Move disk from pole ",src," to pole ",dest);
        move(n-1, via, src, dest)
    fi
corp
 
proc nonrec main() void: 
    move(4, 1, 2, 3) 
corp