Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Recursion: the Towers of Hanoi problem

by MistaMuShu (Beadle)
on Oct 19, 2004 at 23:30 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://400700]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-18 02:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found