Help for this page

Select Code to Download


  1. or download this
    sub factorial 
    {
    ...
       return 1 if $n == 0;
       return factorial($n-1) * $n;
    }
    
  2. or download this
    sub hanoi 
    {
    ...
          hanoi($n-1, $extra, $end, $start);
       }
    }
    
  3. or download this
    Move disk #1 from A to C.
    Move disk #2 from A to B.
    ...
    Move disk #1 from B to A.
    Move disk #2 from B to C.
    Move disk #1 from A to C.