Task

Solve the   Towers of Hanoi   problem with recursion.




move := proc(n::number, src::number, dst::number, via::number) is
   if n > 0 then
      move(n - 1, src, via, dst)
      print(src & ' to ' & dst)
      move(n - 1, via, dst, src)
   fi
end
 
move(4, 1, 2, 3)