Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. i need help in my project...

i need help in my project...

Scheduled Pinned Locked Moved C#
helplounge
10 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hazem maher
    wrote on last edited by
    #1

    I want your help in my project(Hanoi Tower2).... Towers of Hanoi The ancient folklore behind the “Towers of Hanoi” puzzle is quite well known. A more recent legend tells us that once the Brahmin monks discovered how long it would take to finish transferring the 64 discs from the needle which they were on to one of the other needles, they decided to find a faster strategy and be done with it. One of the priests at the temple informed his colleagues that they could achieve the transfer in single afternoon at a one disc-per-second rhythm by using an additional needle. He proposed the following strategy: • First move the topmost discs (say the top k discs) to one of the spare needles. • Then use the standard three needles strategy to move the remaining n − k discs (for a general case with n discs) to their destination. • Finally, move the top k discs into their final destination using the four needles. He calculated the value of k which minimized the number of movements and found that 18,433 transfers would suffice. Thus they could spend just 5 hours, 7 minutes, and 13 seconds with this scheme versus over 500, 000 million years without the additional needle! Try to follow the clever priest’s strategy and calculate the number of transfers using four needles, where the priest can move only one disc at a time and must place each disc on a needle such that there is no smaller disc below it. Calculate the k that minimizes the number of transfers under this strategy. Input The input file contains several lines of input. Each line contains a single integer 0 ≤ N ≤ 10, 000 giving the number of disks to be transferred. Input is terminated by end of file. Output For each line of input produce one line of output which indicates the number of movements required to transfer the N disks to the final needle. Sample Input 1 2 28 64 Sample Output 1 3 769 18433 can u help me....

    C P L 3 Replies Last reply
    0
    • H hazem maher

      I want your help in my project(Hanoi Tower2).... Towers of Hanoi The ancient folklore behind the “Towers of Hanoi” puzzle is quite well known. A more recent legend tells us that once the Brahmin monks discovered how long it would take to finish transferring the 64 discs from the needle which they were on to one of the other needles, they decided to find a faster strategy and be done with it. One of the priests at the temple informed his colleagues that they could achieve the transfer in single afternoon at a one disc-per-second rhythm by using an additional needle. He proposed the following strategy: • First move the topmost discs (say the top k discs) to one of the spare needles. • Then use the standard three needles strategy to move the remaining n − k discs (for a general case with n discs) to their destination. • Finally, move the top k discs into their final destination using the four needles. He calculated the value of k which minimized the number of movements and found that 18,433 transfers would suffice. Thus they could spend just 5 hours, 7 minutes, and 13 seconds with this scheme versus over 500, 000 million years without the additional needle! Try to follow the clever priest’s strategy and calculate the number of transfers using four needles, where the priest can move only one disc at a time and must place each disc on a needle such that there is no smaller disc below it. Calculate the k that minimizes the number of transfers under this strategy. Input The input file contains several lines of input. Each line contains a single integer 0 ≤ N ≤ 10, 000 giving the number of disks to be transferred. Input is terminated by end of file. Output For each line of input produce one line of output which indicates the number of movements required to transfer the N disks to the final needle. Sample Input 1 2 28 64 Sample Output 1 3 769 18433 can u help me....

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Gee - here's a piece of homework we've never seen posted before. You've posted the description of hte towers of hanoi. You seem not to be asking for help, but a solution. You need to do your own homework. When you have code that doesn't quite work, feel free to post it and ask specific questions. Until then, the best help we can give you, is encourage you that the purpose of your homework is for you to learn, not for you to get the answer from the web. But, I'd be happy to write it for you, for $200 an hour. That's the sort of contracting rate you will never attract in your life, if you don't do your own homework.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      P M H 3 Replies Last reply
      0
      • C Christian Graus

        Gee - here's a piece of homework we've never seen posted before. You've posted the description of hte towers of hanoi. You seem not to be asking for help, but a solution. You need to do your own homework. When you have code that doesn't quite work, feel free to post it and ask specific questions. Until then, the best help we can give you, is encourage you that the purpose of your homework is for you to learn, not for you to get the answer from the web. But, I'd be happy to write it for you, for $200 an hour. That's the sort of contracting rate you will never attract in your life, if you don't do your own homework.

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        P Offline
        P Offline
        Paul Conrad
        wrote on last edited by
        #3

        Christian Graus wrote:

        Gee - here's a piece of homework we've never seen posted before

        :laugh::laugh::laugh:

        Christian Graus wrote:

        write it for you, for $200 an hour

        Is that all? I charge $500/hr and include a complimentary email to the teacher :->

        C 1 Reply Last reply
        0
        • H hazem maher

          I want your help in my project(Hanoi Tower2).... Towers of Hanoi The ancient folklore behind the “Towers of Hanoi” puzzle is quite well known. A more recent legend tells us that once the Brahmin monks discovered how long it would take to finish transferring the 64 discs from the needle which they were on to one of the other needles, they decided to find a faster strategy and be done with it. One of the priests at the temple informed his colleagues that they could achieve the transfer in single afternoon at a one disc-per-second rhythm by using an additional needle. He proposed the following strategy: • First move the topmost discs (say the top k discs) to one of the spare needles. • Then use the standard three needles strategy to move the remaining n − k discs (for a general case with n discs) to their destination. • Finally, move the top k discs into their final destination using the four needles. He calculated the value of k which minimized the number of movements and found that 18,433 transfers would suffice. Thus they could spend just 5 hours, 7 minutes, and 13 seconds with this scheme versus over 500, 000 million years without the additional needle! Try to follow the clever priest’s strategy and calculate the number of transfers using four needles, where the priest can move only one disc at a time and must place each disc on a needle such that there is no smaller disc below it. Calculate the k that minimizes the number of transfers under this strategy. Input The input file contains several lines of input. Each line contains a single integer 0 ≤ N ≤ 10, 000 giving the number of disks to be transferred. Input is terminated by end of file. Output For each line of input produce one line of output which indicates the number of movements required to transfer the N disks to the final needle. Sample Input 1 2 28 64 Sample Output 1 3 769 18433 can u help me....

          P Offline
          P Offline
          Professor Sharada Ulhas
          wrote on last edited by
          #4

          hazem! this is your professor from teh university. whent i heard of your posted homoworks on the cpian websites i had a doubt it could be true. then i am seeing it before mine own eyejob and i must not have a blow doubt about it@! i told must students of sensual nature never to post, no, on the homoCpians websites! becauze you do this horrible thing i must give you the utter cursings of shiva brama and krisna and blue man group. vile humo shiva bar kuntso! p.s. plus blackened grade. and no more sensual acts with student at the university. :((

          Sincelery yours, Computer Information conSciences Professor and grader, Sharada Ulhas

          H 1 Reply Last reply
          0
          • P Paul Conrad

            Christian Graus wrote:

            Gee - here's a piece of homework we've never seen posted before

            :laugh::laugh::laugh:

            Christian Graus wrote:

            write it for you, for $200 an hour

            Is that all? I charge $500/hr and include a complimentary email to the teacher :->

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            Paul Conrad wrote:

            Is that all?

            He's a student, that's my student discount :P

            Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

            P 1 Reply Last reply
            0
            • C Christian Graus

              Paul Conrad wrote:

              Is that all?

              He's a student, that's my student discount :P

              Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

              P Offline
              P Offline
              Paul Conrad
              wrote on last edited by
              #6

              Christian Graus wrote:

              that's my student discount;P

              :laugh::laugh::laugh: Wow, I guess I'm not that lenient :->

              1 Reply Last reply
              0
              • C Christian Graus

                Gee - here's a piece of homework we've never seen posted before. You've posted the description of hte towers of hanoi. You seem not to be asking for help, but a solution. You need to do your own homework. When you have code that doesn't quite work, feel free to post it and ask specific questions. Until then, the best help we can give you, is encourage you that the purpose of your homework is for you to learn, not for you to get the answer from the web. But, I'd be happy to write it for you, for $200 an hour. That's the sort of contracting rate you will never attract in your life, if you don't do your own homework.

                Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

                M Offline
                M Offline
                Muammar
                wrote on last edited by
                #7

                The dude's profile:

                Messages Posted 1 - Poster Articles Submitted 0 - Browser

                Dont you guys think it's about time to put an end to these homework posters??


                Smile: A curve that can set a lot of things straight! (\ /) (O.o) (><)

                1 Reply Last reply
                0
                • C Christian Graus

                  Gee - here's a piece of homework we've never seen posted before. You've posted the description of hte towers of hanoi. You seem not to be asking for help, but a solution. You need to do your own homework. When you have code that doesn't quite work, feel free to post it and ask specific questions. Until then, the best help we can give you, is encourage you that the purpose of your homework is for you to learn, not for you to get the answer from the web. But, I'd be happy to write it for you, for $200 an hour. That's the sort of contracting rate you will never attract in your life, if you don't do your own homework.

                  Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

                  H Offline
                  H Offline
                  hazem maher
                  wrote on last edited by
                  #8

                  iam sorry i understand the rules now. iam very sorry.

                  1 Reply Last reply
                  0
                  • P Professor Sharada Ulhas

                    hazem! this is your professor from teh university. whent i heard of your posted homoworks on the cpian websites i had a doubt it could be true. then i am seeing it before mine own eyejob and i must not have a blow doubt about it@! i told must students of sensual nature never to post, no, on the homoCpians websites! becauze you do this horrible thing i must give you the utter cursings of shiva brama and krisna and blue man group. vile humo shiva bar kuntso! p.s. plus blackened grade. and no more sensual acts with student at the university. :((

                    Sincelery yours, Computer Information conSciences Professor and grader, Sharada Ulhas

                    H Offline
                    H Offline
                    hazem maher
                    wrote on last edited by
                    #9

                    iam so sorry i understand the rules now..... iam so sorry....

                    1 Reply Last reply
                    0
                    • H hazem maher

                      I want your help in my project(Hanoi Tower2).... Towers of Hanoi The ancient folklore behind the “Towers of Hanoi” puzzle is quite well known. A more recent legend tells us that once the Brahmin monks discovered how long it would take to finish transferring the 64 discs from the needle which they were on to one of the other needles, they decided to find a faster strategy and be done with it. One of the priests at the temple informed his colleagues that they could achieve the transfer in single afternoon at a one disc-per-second rhythm by using an additional needle. He proposed the following strategy: • First move the topmost discs (say the top k discs) to one of the spare needles. • Then use the standard three needles strategy to move the remaining n − k discs (for a general case with n discs) to their destination. • Finally, move the top k discs into their final destination using the four needles. He calculated the value of k which minimized the number of movements and found that 18,433 transfers would suffice. Thus they could spend just 5 hours, 7 minutes, and 13 seconds with this scheme versus over 500, 000 million years without the additional needle! Try to follow the clever priest’s strategy and calculate the number of transfers using four needles, where the priest can move only one disc at a time and must place each disc on a needle such that there is no smaller disc below it. Calculate the k that minimizes the number of transfers under this strategy. Input The input file contains several lines of input. Each line contains a single integer 0 ≤ N ≤ 10, 000 giving the number of disks to be transferred. Input is terminated by end of file. Output For each line of input produce one line of output which indicates the number of movements required to transfer the N disks to the final needle. Sample Input 1 2 28 64 Sample Output 1 3 769 18433 can u help me....

                      L Offline
                      L Offline
                      Luc Pattyn
                      wrote on last edited by
                      #10

                      Hi, I can confirm 18,433 transfers is correct minimum for 64 discs. You can solve all such problems with a little program (below 50 lines of code). :)

                      Luc Pattyn [My Articles]

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups