hanoi tower

Go4Expert Member
26Mar2011,00:26   #1
sahar_2010's Avatar
hi
i want a program about hanoi tower with 4 peg.
can anyone here guide me?
i want it with C language.
plz help me,i need this program.
notice that its 4 peg not 3.
Go4Expert Founder
26Mar2011,09:12   #2
shabbir's Avatar
Have you done anything with the work or want to have a ready made solution.
Go4Expert Member
26Mar2011,12:48   #3
sahar_2010's Avatar
Quote:
Originally Posted by shabbir View Post
Have you done anything with the work or want to have a ready made solution.
yeah a little but i couldnt solve it.it has so many errors.
can u tell me a solution?
thanks.
Go4Expert Member
27Mar2011,00:20   #5
sahar_2010's Avatar
]
thanks but i need it in c language and noticed that its 4 peg .
Mentor
27Mar2011,00:22   #6
xpi0t0s's Avatar
Well we're not going to do your homework for you. Have another go and see how far you get, then post the code and we'll help you move on. HINT (a really big one) don't try to write the whole lot before compiling it. Just write a bit, then test it, and this way if you get "so many errors" there's a limited scope for them.
Go4Expert Member
27Mar2011,12:29   #7
sahar_2010's Avatar
Quote:
Originally Posted by xpi0t0s View Post
Well we're not going to do your homework for you. Have another go and see how far you get, then post the code and we'll help you move on. HINT (a really big one) don't try to write the whole lot before compiling it. Just write a bit, then test it, and this way if you get "so many errors" there's a limited scope for them.
i dont want u to write my homework.
i have written it.here is the code but it has some errors that i dont understand them.plz if u can help me.

Code:
Code:
int main()
{
printf("Enter the number of Disks:");
scanf("%d",&n);
transfer(n,'a','b','c','d');
return 0;
}
void Transfer( int TedadeDisk, char From, char To, char Temp1,char Temp2) { if (TedadeDisk > 0) { Transfer(TedadeDisk-1,From,Temp1,To,Temp2); //Counter(From,To); //Msg(From,To); //Move(TedadeDisk,From,To,CounterL,CounterC1,Counter C2,CounterR); Transfer(TedadeDisk-1,Temp1,To,Temp2,From); } }
plz guide me.
thanks.
Mentor
27Mar2011,22:40   #8
xpi0t0s's Avatar
What are the errors?
sahar_2010 like this
Go4Expert Member
28Mar2011,21:29   #9
sahar_2010's Avatar
Quote:
Originally Posted by xpi0t0s View Post
What are the errors?
this program now worked
i have done it with the help of u.
thanks so much