The Tower of Hanoi ================== for MirageOS by Andreas Finne a_finne@hotmail.com tcpa.calc.org Date: 6 Aug 2000 Introduction: ------------- At the time of the creation, a temple was built in Benares. Inside the great temple there were 64 golden disks, all of different sizes and mounted on three diamond pegs. The god Brahma placed all the disks on one peg, in order of size with the largest at the bottom. The task of the temple priests is to transfer the disks unceasingly from peg to peg, one at a time, never placing a larger disk on a smaller one. When all the disks have been transferred, the universe will end... Today, the task of the priests is nearly forgotten, but there is one thing that reminds us of the legend. That thing is the puzzle called The Tower of Brahma, the puzzle also known as the Tower of Hanoi... Instructions: ------------- This is the classic puzzle The Tower of Hanoi. The object is to move all the pieces from one pin to another. The problem is that you can only move one piece at a time, and you are only allowed to put a smaller piece on a larger one, never a larger one onto a smaller one. When all the pieces have been moved to another pin, the puzzle is completed. There is one new thing that isn't in the classical version of the puzzle. That thing is PUZZLE MODE. The difference from normal mode is that your very intelligent TI-83(+) has tried to solve the puzzle, but he/she has given up. Your task is to complete the puzzle for him/her. Controls: --------- Menu: ENTER starts game with the current options LEFT/RIGHT changes the activated option UP changes to block option when mode option is selected DOWN changes to mode option when block option is selected CLEAR or MODE exits the program In game: Y= first pin ZOOM second pin GRAPH third pin MODE return to menu Notes: ------ - When you are in the game, a number is shown in the upper left corner. That number is the number of moves you have made. There is a formula for calculating the minimum number of moves for completing the puzzle: 2^n - 1, where n is the number of pieces. This is of course when playing in normal mode. - The source is included but it's not commented at all. I started on this game a long time ago, and it's just recently that I fixed it up. When I optimized the code I didn't understand/remember how the drawing routine works, so don't feel bad if you don't get it. It probably could be optimized a lot but I hadn't got the patience to do it. Thanks to: ---------- TCPA - for letting me join them And then the usual thing: ------------------------- If your calculator crashes, freezes up, blows up, or throws up, it's not my fault. Andreas Finne a_finne@hotmail.com