Task

Solve the   Towers of Hanoi   problem with recursion.




~~~
{ 'Num 'From 'To 'Via } [ var ] a:for-each 
 
:set     !Via !To !From !Num ; 
:display @To @From 'Move_a_ring_from_%n_to_%n\n s:format s:put ; 
 
:hanoi (num,from,to,via-) 
  set @Num n:-zero? 
  [ @Num @From @To @Via 
    @Num n:dec @From @Via @To hanoi set display 
    @Num n:dec @Via @To @From hanoi ] if ; 
 
#3 #1 #3 #2 hanoi nl 
~~~