Slashdot Mirror


108 Ways To Do The Towers of Hanoi

hlarwood74 writes "While it is common to program in a few different languages, somebody has written "towers of hanoi" in 108 different ways, most of them in different programming languages. It's not just the number of languages though ... there are many neat implementations and in some cases he's come up with some strange ways of solving hanoi such as this: "you ping the hanoi machine with the number of disks encoded in the type of service field, and you get response packets whose sequence numbers represent the disk moves need to solve the puzzle". I wanted to ask "why" but the title of the page (hanoimania) explains a few things :)"

19 of 192 comments (clear)

  1. Next up: 108 ways to post the same story on /. by corebreech · · Score: 5, Funny

    nt

  2. Isn't there a legend involved? by 91degrees · · Score: 5, Funny

    When someone works out every single way to solve the problem, the towers will crumble to dust and the world will vanish

  3. Re:Reverse DOS? by Crypto+Gnome · · Score: 1, Funny

    Yea Yeah Yeah, I know the TOS field isn't big enough to show 128.

    It's a joke, so laugh.

    --
    Visit CryptoGnome in his home.
  4. My addition by kinnell · · Score: 5, Funny

    Here it is coded in Whitespace:





    --
    If I seem short sighted, it is because I stand on the shoulders of midgets
    1. Re:My addition by ShootThemLater · · Score: 5, Funny

      Hmmm, looks like slashcode's added a couple of extra whitespaces in there. Won't compile.

  5. But what about... by Mr.+Mosty-Toasty · · Score: 3, Funny

    ...Brainfuck?

  6. pfff ... Big deal ... by cablepokerface · · Score: 5, Funny

    Converting the Towers of Hanoi syntax into 108 different languages?

    Visual Studio.NET includes a standard wizard for that.

  7. What? No Intercal? by dm(Hannu) · · Score: 0, Funny

    No language comparison is complete without Intercal.

  8. Re:Whitespace? by FrostedWheat · · Score: 5, Funny

    Maybe they did, but you just didn't see it?

  9. yeah... by AbbyNormal · · Score: 5, Funny

    to the joy of millions of 1st year Computer Science students.

    --
    Sig it.
    1. Re:yeah... by cdrudge · · Score: 3, Funny

      And much to the chagrin of thousands of CS profs.

  10. Re:what if he had spent his time on something usef by johannesg · · Score: 4, Funny

    ...he said in a posting on slashdot.

  11. Re:Whitespace? by ObviousGuy · · Score: 2, Funny

    I have discovered a truly marvelous demonstration of this proposition and have encoded it here in Whitespace.

    --
    I have been pwned because my /. password was too easy to guess.
  12. Re:What is the most disks you have solved for? by fbform · · Score: 3, Funny

    Eight here too. In fact when I first heard of the problem (when I was 10 I think), it specified 8 disks. Never occurred to me to solve for a smaller problem first. It took me some 14 months to find a solution for the 8-disk problem by myself. Man, those were the days! I used playing cards instead of disks, and everybody around me thought I was playing some weird form of Solitaire. Sigh.
    Yes, I'm still single. Why do you ask?

    --
    Time flies like an arrow. Fruit flies like a banana.
  13. Re:What is the most disks you have solved for? by jtdubs · · Score: 2, Funny

    10 here. i wrote a computer program to draw a sexy 3d version of it and let me move pieces by tapping the 1, 2 and 3 keys. after solving 4 or 5 discs a few times my fingers would get into this wierd zone where they'd just fly over those three keys without any conscious thought. very cool.

    justin

  14. I'm surprised no one has suggested... by EvilLile · · Score: 2, Funny
    Malbolge. Who ever said programming was supposed to be easy or fun?

    Malbolge, Programming From Hell

  15. When I read the title.. by Anonymous Coward · · Score: 1, Funny

    I thought of 108 Ways To Do The Girls of Hanoi.

    Much more, uh, arousing.

  16. Well, you know waht they say... by David+Gould · · Score: 3, Funny


    I wanted to ask "why"

    Never ask a geek "why". Just nod slowly as you back away.

    --
    David Gould
    main(i){putchar(340056100>>(i-1)*5&31|!!(i<6)<< 6)&&main(++i);}
  17. towers implemented as a Slashdot thread by Anonymous Coward · · Score: 2, Funny

    ``=I=`` I I
    `==I==` I I
    ===I=== I I

    Your move.

    (You wouldn't believe how long it took to get this to display correctly and get past the lameness filter)