Post Reply 
HHC 2017 RPN Programming contest information and results thread
09-17-2017, 11:51 PM (This post was last modified: 09-18-2017 12:26 AM by Gerson W. Barbosa.)
Post: #16
RE: HHC 2017 RPN Programming contest information and results thread
74 bytes, stack-only... on the 42S. Probably more on the 41CX and surely even more if done by the rules (without AIP).
Interesting programming exercise as always. Thanks!

-----------

Edited to include 42S code. Size optimization not tried yet.

Code:

00 { 74-Byte Prgm }
01▸LBL "HAPPY"
02 CLA
03 0
04 STO ST Z
05 STO ST T
06▸LBL 00
07 CLX
08 R↓
09▸LBL 01
10 10
11 %
12 IP
13 X<>Y
14 X<> ST L
15 FP
16 STO× ST X
17 STO+ ST T
18 SIGN
19 ×
20 X≠0?
21 GTO 01
22 X<> ST Z
23 2
24 10↑X
25 ×
26 1
27 STO+ ST Z
28 X=Y?
29 GTO 03
30 CLX
31 4
32 X≠Y?
33 GTO 00
34 "UN"
35▸LBL 03
36 ├"HAPPY "
37 RCL ST Z
38 AIP
39 AVIEW
40 END
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HHC 2017 RPN Programming contest information and results thread - Gerson W. Barbosa - 09-17-2017 11:51 PM



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