1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

hanoi tower

Discussion in 'C' started by sahar_2010, Mar 25, 2011.

  1. sahar_2010

    sahar_2010 New Member

    Joined:
    Dec 29, 2010
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    no job,just studyning
    Location:
    Iran
    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.
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,293
    Likes Received:
    365
    Trophy Points:
    83
    Have you done anything with the work or want to have a ready made solution.
     
  3. sahar_2010

    sahar_2010 New Member

    Joined:
    Dec 29, 2010
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    no job,just studyning
    Location:
    Iran
    yeah a little but i couldnt solve it.it has so many errors.
    can u tell me a solution?
    thanks.
     
  4. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
  5. sahar_2010

    sahar_2010 New Member

    Joined:
    Dec 29, 2010
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    no job,just studyning
    Location:
    Iran
    ]
    thanks but i need it in c language and noticed that its 4 peg .
     
  6. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    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.
     
  7. sahar_2010

    sahar_2010 New Member

    Joined:
    Dec 29, 2010
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    no job,just studyning
    Location:
    Iran
    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);
    }
    }


    [/CODE]

    plz guide me.
    thanks.
     
  8. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    What are the errors?
     
    sahar_2010 likes this.
  9. sahar_2010

    sahar_2010 New Member

    Joined:
    Dec 29, 2010
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    no job,just studyning
    Location:
    Iran
    this program now worked
    i have done it with the help of u.
    thanks so much
     

Share This Page