contents

meta

Hanoimania!

What?

This page contains my various (over a hundred) implementations of the Towers of Hanoi problem, or rather, its solution. Some of these are understandably weird. While some differ in the "programming language" (loosely speaking) of implementation (there's one in LOGO, for example), there are many others that differ in concept.

You can save the above script to a file and try "echo xxx | sed -f filename". Some sed implementations, like the one on some versions of Solaris, might choke on the above because of trailing text after labels. In that case try this differently formatted version. Here is a version with no newlines.

Why?

I am often asked that since I do all this, whether I have a lot of free time on my hands. Between my work and my interests (both of which overlap to a great extent), I actually have no free time. As an aside, I would not (and should not) be expected to "know" so many programming languages, and I don't think I do. However, knowing a computer language is a rather fuzzy idea. If one could write a useful (loosely speaking, again) program in a given language, it is instructive to question whether one knows it.

It is ironical (yes, there is such a word) that the bigger challenge lies not in writing programs in all these different languages and ways, but in rapidly setting up the respective compiler systems and/or development environments on an appropriate platform/operating system. Sometimes compilers, interpreters and other such software for a particular language may be readily available, and run "out of the box", but many times this is not the case. Sometimes it turns out to be a non-trivial problem to get a compiler to function (pun unintended). Of course, once you get past this, you do have to understand some subset of the language!

FAQ

If you have a comment, question or any other feedback, please check the FAQ first to see if I have responded to a similar question already.

Download

You can download all Hanoi implementations as a single archive (gzipped tar file), or browse and download individual implementations as listed below.