Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: The Mother Of All C Problems

  1. #11
    Senior Member therenegade's Avatar
    Join Date
    Apr 2003
    Posts
    400
    Erm 7 minutes 57secs here lol..I timed myself
    too lazy to do the coding though...isnt diffcult at all really...

  2. #12
    Senior Member PacketThirst's Avatar
    Join Date
    Aug 2004
    Posts
    258
    I donno .. i solved 7 disks on the site ... managed to mentally solve 4 disks ..But i can't find a
    RECURSIVE pattern !! ...

  3. #13
    dont think of it in terms of the disks thats some advice
    my solution is deffinatly recursive, so the solution exists iterative seems to be a bit harder actually

  4. #14
    Senior Member
    Join Date
    Oct 2001
    Posts
    786
    Well, if you study how the bricks are de-built and re-built, you would notice some sort of pattern. I've attached a screen capture that depicts doing a near perfect job with 6 of the 7 discs. I was going to include the 7th one, but I got lost and confused and didn't feel like redoing it. So think of it as a solution to the 6 disc problem. Time: 2:26. Practice: A total of ~8 tries including my first try ever.


    As you watch, notice how the combinations start out pretty easy...


    --------------------

    Building a tower of 2 - move 1st brick to empty pole that won't be the base. Move the 2nd brick to the pole that will be the base. Put the 1st brick on the 2nd brick.

    Building a tower of 3 - Build a tower of 2 where the tower of 3 won't be. Move the 3rd brick to an empty pole as the base. Move the 1st brick from the tower of 2 onto an empty pole. Put the 2nd brick from the tower of 2 on the 3rd brick. Move the 1st brick onto the 2nd brick.

    Building a tower of 4 - Build a tower of 3 where the tower of 4 won't be. ... Note, this one doesn't acturally follow the above rules of 2 and 3 disc towers. The top disc of the tower of 3 will go on to the base of the tower of 4, instead of an empty pole...

    --------------------


    It is highly recursive. It is also even and odd. And probably some combination of building and de-building depending on how many discs there are. Hopefully watching me solve some of this gives some insight into how to solve this. I have tried coding it, but am unable to find a sane way to store the data, and don't have the time to continue it. May my video help you understand it

    BTW, I haven't really reviewed the video in-depth to see if I made any blantly obvious mistakes. I just cut it after I built a tower of 6 because my tower of 7 was a mess...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •