= #JxnPortable/docs/programmer_examples/demos/Hanoi_print_Demo.jxn ...

#function move( n, from, to, using )  ! towers of Hanoi
   #if gt( n, 1 )
      move( n - 1, from, using, to )
      print( "move " + n + ". from " + from + " to " + to )
      move( n - 1, using, to, from )
   #else
      print( "move 1. from " + from + " to " + to )
   #endif
#endfunction

print = @JxnFunction( $this, "o", "o" )
 = ( o ) -> o (JxnFunction)
print.setDebug 1  ! allow output from print
 = 0 (int)

#if false
$this.setHideTypeOutput 4  ! option: suppress type output
#else


move( 3, "A", "B", "C" );
: o
:  = move 1. from A to B (java.lang.String)
: o
:  = move 2. from A to C (java.lang.String)
: o
:  = move 1. from B to C (java.lang.String)
: o
:  = move 3. from A to B (java.lang.String)
: o
:  = move 1. from C to A (java.lang.String)
: o
:  = move 2. from C to B (java.lang.String)
: o
:  = move 1. from A to B (java.lang.String)