Help for this page

Select Code to Download


  1. or download this
    print "Move disk $num from $from to $to\n";
    movedisks( $num-1, $aux, $to, $from );
    
  2. or download this
    $numdisks = 3
    movedisks( 3-1, A, C, B) 
    movedisks( 2-1, A, B, C) 
    print "Move disk 1 from A to B" for the base case