Post Reply 
HHC 2015 RPN programming Contest is now open
09-29-2015, 06:16 AM
Post: #41
RE: HHC 2015 RPN programming Contest is now open
Here is my entry, from the conference. I think if Gene bothered to look as far down the entry list as this, I may have won the Max-Byte Bloatware prize, the Inelegant Effort prize, the Spaghetti prize or all of those. But it works. And it was difficult to focus on programming during the conference, at least it was for me.

It would've been 73 bytes without the unnecessary XEQ RR at the end, and 69 bytes if I had been clever enough to think of using DSE instead of ISG. Ahhhh, re-learning how to program on calculators, what could be more fun?

Very interesting entries and different approaches to the problem. Many thanks to Gene for sending this problem out to the world. And many congratulations to Gunter for the elegant and brilliant winning solution at the conference!

Line 42s bytes 77
01 LBL RR
02 XEQ SORT
03 CLX
04 STO 08
05 1.004
06 STO 06
07 IP
08 STO 07
09 CF 05
10 LBL 04
11 1
12 STO+ 07
13 RCL IND 07
14 RCL IND 06
15 -
16 X<=y? check step is it 1? (not a big step)
17 GTO 01 it is 1, OK go to add 1, isg, loop
18 2 it is big step is It 1st step? 2 is compare criteria
19 RCL 06 isg value
20 X<Y? if it is not 1st check, then is it last step? (3)
21 GTO 02 go to regular error, not 1st step but check for last step
22 4
23 X>Y? if it is not last check, then regular error (05)
24 GTO 05 go to regular error, not 1st step and not last step
25 GTO 02 if it is 1st check or last check, don't mark error, and go back
26 LBL 05
27 SF 05 set big step flag
28 LBL 01 Add it to 08, isg, loop
29 STO+ 08
30 LBL 02
31 ISG 06 check for finish
32 GTO 04 if not finsihed loop again
33 3 finishing, check total
34 RCL 08 finishing, check total
35 - finishing, check total
36 X<=0? if (08) is 4 or 3, it could be good, otherwise it is smaller
37 CLST
38 FS?C 05 if it is bad something other than 0
39 2
40 STOP
41 XEQ RR
42 END
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HHC 2015 RPN programming Contest is now open - DanM - 09-29-2015 06:16 AM



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