Post Reply 
Weakest calculator/pocket computer that can do Tower of Hanoi?
08-12-2018, 07:46 AM
Post: #8
RE: Weakest calculator/pocket computer that can do Tower of Hanoi?
(08-12-2018 07:16 AM)Thomas Klemm Wrote:  This program for the HP-11C implements A001511:
Code:
01▸LBL A
02 1
03▸LBL 0
04 x<>y
05 2
06 ÷
07 FRAC
08 x≠y
09 GTO 1
10 R↓
11 LSTx
12 x<>y
13 1
14 +
15 GTO 0
16▸LBL 1
17 R↓
18 RTN

That program always returns 1, for any input.

Even if it did do what you say it should do, it would still be only a partial solution, because all it would tell you is which disc should be moved at any given step. The reason why my (second) program is so much longer is because it works out from from which to which position the disc is moved.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Weakest calculator/pocket computer that can do Tower of Hanoi? - Thomas Okken - 08-12-2018 07:46 AM



User(s) browsing this thread: 1 Guest(s)