3 ms·
Still a good read (from 1971 then with .pdf Adobe Acrobat optimized). The Towers of Hanoi simulation section brings back memories of an old Wang 2200 Basic mach
by escherplex 8y ago
Still a good read (from 1971 then with .pdf Adobe Acrobat optimized). The Towers of Hanoi simulation section brings back memories of an old Wang 2200 Basic machine (64K as I remember) buried in storage at my old prep school which we managed to bring back to life (more or less) . Decided to write a Towers of Hanoi game using its available box graphics, which could be animated but which quickly taught the maxim: write forward then erase behind (otherwise the imagery appears jumpey). The results were similar to the 'Towers of Hanoi' app now on ROKU 4. But how to add an animated 'solve' function? Raw strings (for 2: top small 1 -> 2, top small 1 -> 3, top small 2 -> 3) ate up too much memory beyond 7 (2^n - 1 = 127) so system analysis suggested: give the smallest box a life of it's own and if total number of discs to be moved is even, script the smallest to follow a path 1 -> 2, 2 -> 3, 3 -> 1, 1 -> 2 etc. for first then every other move. If total number of discs odd, script it a path 1 -> 3, 3 -> 2, 2 -> 1, 1 -> 3 etc for first then for every other move (until you're done). Each next alternate move is any valid move (top smallest on any other column move to any other column with no disks or with column with top disk larger than that one). Seem to recall Martin Gardner had a similar solution in an old Scientific American 'Mathematical Games' article.