Post Reply 
(HP48) Beginner questions about RPL
10-23-2024, 09:05 PM (This post was last modified: 10-23-2024 09:30 PM by Gil.)
Post: #5
RE: (HP48) Beginner questions about RPL
To see the list of all intermediate numbers in the algorithm, the given code could be modified as follows:

\<< DUP "Start number" \->TAG 1 \->LIST 0 ROT
WHILE DUP 1 >
REPEAT
IF DUP 2 MOD
THEN 3 * 1 +
ELSE 2 /
END SWAP 1 + SWAP DUP 4 ROLL SWAP + UNROT
END DROP "Steps" \->TAG
\>>

Or
<< DUP "Start number" ->TAG 1 ->LIST 0 ROT
WHILE DUP 1 >
REPEAT
IF DUP 2 MOD
THEN 3 * 1 +
ELSE 2 /
END SWAP 1 + SWAP DUP 4 ROLL SWAP + UNROT
END DROP "Steps" ->TAG
>>
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (HP48) Beginner questions about RPL - Gil - 10-23-2024 09:05 PM



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