contents

meta

The Towers Of Hanoi in sed

The script can be tried as follows (assuming you saved it to a file called
hanoi.sed:

% echo xxx | sed -f hanoi.sed

The above command would solve a puzzle for 3 disks (hence the 3 'x's). Click here to download the script, which should work with GNU sed or any robust implementation of sed. In case the script causes sed to choke (for example, on Solaris, sed might complain about "labels being too long"), try the differently formatted version here.