Help for this page

Select Code to Download


  1. or download this
            hanoi( $n - 1, $start, $extra, $end );
            $move_disk->( $n, $start, $end );
            hanoi( $n - 1, $extra, $end, $start );
    
  2. or download this
            hanoi( $n - 1, $start, $extra, $end, $move_disk );
            $move_disk->( $n, $start, $end );
            hanoi( $n - 1, $extra, $end, $start, $move_disk );
    
  3. or download this
    sub hanoi
    {
    ...
    
    hanoi( $disk, 'A', 'B', 'C', \&check_move );
    hanoi( $disk, 'A', 'B', 'C', \&hprint );