31
Mar

Hanoi Tower?

Author: admin

Write a complete program of the famous Hanoi Towers. The program should read the integer n from the user and print a sequence of instructions of the form:

move top disk from A to B

move top disk from A to C

move top disk from C to B

…..etc….etc…..etc…..etc…..

I really really need help with this


Answer:
Check out Planet Source Code. Here are links for

VB6:

http://www.planetsourcecode.com/vb/scrip…

C/C :

http://www.planetsourcecode.com/vb/scrip…

Java/JavaScript:

http://www.planetsourcecode.com/vb/scrip…

C#.NET/VB.NET:

http://www.planetsourcecode.com/vb/scrip…


Answer:
This is a classic programming problem, generally encountered when you reach "Recursion"

Go to the chapter/section of the book that you're using that deals with recursion, and work it out.

Programming is all about learning to break the problem into many smaller units, and solving each of them. And the only way to get there is through practice, and a lot of mental sweat.

Sorry, but that is really the best answer you are going to get. Like it or not.


Answer:
It doesn't hurt to have the algorithm as well.

Answer:
we just went over the hanoi tower program a few days ago… but i dont have the program with me… but just like the first user said… u need recursion. it doesnt require that much code… but recursion it is complicated, at least to me. good luck with that… and remember to research well the recursion part.

Book Mark it-> del.icio.us | Reddit | Slashdot | Digg | Facebook | Technorati | Google | StumbleUpon | Window Live | Tailrank | Furl | Netscape | Yahoo | BlinkList

This entry was posted on Monday, March 31st, 2008 at 4:41 am and is filed under Programming. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or TrackBack URI from your own site.

Leave a reply

Name (*)
Mail (*)
URI
Comment