Task

Solve the   Towers of Hanoi   problem with recursion.




 
{def move
 {lambda {:n :from :to :via}
  {if {<= :n 0}
   then >
   else {move {- :n 1} :from :via :to}
         move disk :n from :from to :to {br}
        {move {- :n 1} :via :to :from} }}}
-> move
{move 4 A B C}
> move disk 1 from A to C
> move disk 2 from A to B
> move disk 1 from C to B
> move disk 3 from A to C
> move disk 1 from B to A
> move disk 2 from B to C
> move disk 1 from A to C
> move disk 4 from A to B
> move disk 1 from C to B
> move disk 2 from C to A
> move disk 1 from B to A
> move disk 3 from C to B
> move disk 1 from A to C
> move disk 2 from A to B
> move disk 1 from C to B 
 