473,378 Members | 1,372 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

towers of honoi problem

Hi sir this is siva, i need on coding of towers of honoi problem in c language.The out will be like this.... it will show graphical movement of discs from one tower to another tower according to statements on screen. But with out using any graphical concepts with only c langauge concept .I need this very urgent can u help me .
Thanks for ur help.
Aug 19 '07 #1
2 2307
JosAH
11,448 Expert 8TB
Hi sir this is siva, i need on coding of towers of honoi problem in c language.The out will be like this.... it will show graphical movement of discs from one tower to another tower according to statements on screen. But with out using any graphical concepts with only c langauge concept .I need this very urgent can u help me .
Thanks for ur help.
The name is 'Hanoi', not 'Honoi'; the essence of the solution is this: suppose
you have three tower positions: 'A', 'B and C. If you are able to move a tower
containing n disks from position 'A to position B, you are also able to move it
from position A to position C, just change positions B and C along the way.

But then you are able to move a tower containing n+1 disks from position A to
position B: move the top n disks from A to C, move the largest disk from A to B
and finally move those n disks from position C to B on top of that largest disk.
Because all disks are smaller than that largest disk, that largest disk will never
block any move.

Of course you can move a tower containing zero disks from any position to any
other position. All the rest is complete induction.

kind regards,

Jos
Aug 19 '07 #2
kreagan
153 100+
Hi sir this is siva, i need on coding of towers of honoi problem in c language.The out will be like this.... it will show graphical movement of discs from one tower to another tower according to statements on screen. But with out using any graphical concepts with only c langauge concept .I need this very urgent can u help me .
Thanks for ur help.
What's your question? If you google "Hanoi", you should find A LOT of information with explanations of how the game works and psuedo code.

Also, the C language does have a GUI library. Are you having problems with that?
Aug 19 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Kostatus | last post by:
I have a virtual function in a base class, which is then overwritten by a function of the same name in a publically derived class. When I call the function using a pointer to the derived class...
8
by: Constant | last post by:
I need a programe that will deal with the solving of the problem ..i have 3 pegs A, B, C...and I want to move the disk A to disk C using B as auxiliary.At the end all disk should be at peg C in the...
117
by: Peter Olcott | last post by:
www.halting-problem.com
18
by: Ian Stanley | last post by:
Hi, Continuing my strcat segmentation fault posting- I have a problem which occurs when appending two sting literals using strcat. I have tried to fix it by writing my own function that does the...
51
by: maloov | last post by:
I have a pretty tough assignment for beginner like me & i'm seeking help please here is the assign In this assignment, you will be guided to complete the program skeleton provided to you in...
6
by: poopsy | last post by:
hi guys cud some1 explain to me the towers of hanoi code, the source code is available evrywhr. i've been trying to understand it bt cant. can some1 plz help me i hav even tried to "trace" it but i...
0
by: Brian Whatcott | last post by:
On Thu, 13 Mar 2008 01:17:40 -0700 (PDT), schoenfeld.one@gmail.com wrote: A very fine case for... what ever it is you are making a case for, I'm sure, and as relevant to any of the other...
1
by: schoenfeld.one | last post by:
In this article we show that "top-down" controlled demolition accurately accounts for the collapse times of the World Trade Center towers. A top-down controlled demolition can be simply...
2
by: sunyboy | last post by:
hi I need a programe "Towers of Hanoi without use recessive function" in c++ Please help. Thanks for your time.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.