4 elements a b c n

: vars !c !b !a !n ;
: hanoi ( num from to via -- )
  vars
  @n 0 <>
  [
    @n @a @b @c
    @n 1- @a @c @b hanoi
    vars
    @b @a "\nMove a ring from %d to %d" puts
    @n 1- @c @b @a hanoi
  ] ifTrue ;

