(16C) Tower of Hanoi
|
01-17-2024, 08:38 AM
Post: #1
|
|||
|
|||
(16C) Tower of Hanoi
I used from Binary solution of Tower of Hanoi:
Quote:Another formulation is from peg (m - (m & -m)) % 3 to peg (m + (m & -m)) % 3 This is an iterative solution for the HP-16C: Code: 000 { } Initialisation DEC 1 STO I RTN Endless Loop R/S Y: to X: from Example: R/S 0 R↓ 2 R/S 0 R↓ 1 R/S 2 R↓ 1 R/S 0 R↓ 2 … Thus:
It doesn't tell you which disk to move but that's not needed. This solution came up in this older thread: Weakest calculator/pocket computer that can do Tower of Hanoi? It is an excerpt from post #20 and post #30. I stumbled upon this thread recently: New HP 16C Simulator released: JRPN 16C On the linked page JRPN - Jovial Reverse Polish Notation Calculators Valentin's solution is mentioned:
The state is already initialised so you can start with R/S … |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)