Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Recursion: the Towers of Hanoi problem

by MistaMuShu (Beadle)
on Oct 19, 2004 at 23:30 UTC ( #400700=note: print w/ replies, xml ) Need Help??

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
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://400700]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2014-10-21 07:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (98 votes), past polls