home *** CD-ROM | disk | FTP | other *** search
- %% Times 12
- % Introduction
-
- The \bTowers of Hanoi\e is a Macintosh version of a classic mathematical
- puzzle. The usual version of this puzzle consists of a wooden base with
- three posts. At the start of the game, a number of disks in graduated
- sizes are stacked on one of the posts so that the smallest disk is on top.
- The object of the puzzle is to move the entire stack of disks to another
- post, subject to the following restrictions:
- 1. You may only move one disk at a time -- all the other disks
- must remain on a post.
- 2. You may only move the topmost disk on any post.
- 3. At no time can a larger disk rest upon a smaller disk.
-
- A little experimentation with this puzzle will convince you that the
- minimum number of moves required to solve it grows rapidly as the
- initial number of disks is increased. In fact, if there are 'N' disks,
- then it will take 2 raised to the Nth power, minus one moves to complete
- the puzzle. So three disks takes 7 moves, 4 disks takes 15 moves,
- 5 disks takes 31 moves, and so on.
-
- According to George Gamow in his book \iOne, Two, Three, Infinity\e,
- the prototype for this puzzle originated in a temple in Hanoi, where
- monks patiently work on a puzzle containing 64 golden disks. Legend
- says that when that puzzle is finally solved, the temple, the earth,
- and the entire universe will vanish in a clap of thunder. Nervous
- readers should work out how many moves will be required to solve a
- 64-disk puzzle before they begin to panic.
-
- % The Towers Application
-
- With this program, you can experiment with puzzles containing from
- two to ten disks. When the program starts, the disks are stacked up on
- the left-hand pin. To move a disk, click anywhere on or near the stack.
- The topmost disk in the stack will be highlighted. Then click anywhere
- near the pin to which you want to move the disk. The selected disk will
- be moved. Continue moving disks in the same way until you solve the
- puzzle. As you move, the program will display the number of moves
- you have done, together with the theoretical minimum number of moves.
-
- If you wish to take back your last move, select "Undo" from the Edit
- menu. Only the most recent move can be taken back.
-
- % Menus
-
- The \bFile\e menu contains only the \bQuit\e command.
-
- The \bEdit\e menu contains the usual \bUndo, Cut, Copy,\e and \bPaste\e
- commands. Only the \bUndo\e command is used by the Towers program.
-
- The \bCommands\e menu contains these commands:
- \bNew\e -- Start the Puzzle at the beginning.
- \bRun\e -- Let the computer solve the puzzle. This command may
- only be used with the disks in the starting position.
- \bStep\e -- Like \bRun\e, except that a single move is made each
- time the \bStep\e command is given.
- \bHelp\e -- You're doing it.
-
- The \bOptions\e menu contains these commands:
- \b2 Disks\e through \b10 Disks\e -- use this many disks. (Issuing
- one of these commands also restarts the puzzle.)
- \bSlow, Faster, Fastest\e -- The \bFaster\e setting speeds up the
- animation somewhat, and the \bFastest\e setting
- suppresses the animation altogether. Use the \bFastest\e
- setting when using the computer to solve a puzzle with a large
- number of disks, unless you enjoy staring at mindless screen
- activity for long periods of time. (sort of like network television)
- \bSound\e -- Toggle the sound on and off.
- \bCycle Colors\e -- Allows you some choice over what colors
- are used for the disks. Of course, if you don't have a color
- monitor, this command won't be very satisfying.
-
- % Miscellaneous
-
- \bTowers\e is FreeWare. You may copy this application and give it away.
- You may NOT sell it or incorporate it into any commercial software
- distribution without the written permission of the author.
-
- \bTowers\e was written in Think C. Portions of the runtime code
- are Copyrighted ⌐ 1989 by Semantic Corporation. This help message
- was written and displayed using Robert Momsen's Help Compiler.
-
- \bTowers\e was written by William M. Leue, and is Copyrighted ⌐ 1989
- by William M. Leue. For further information, contact the author at:
- William M. Leue
- Wildman Software
- 87 Brookline Ave.
- Albany, NY 12203