HHC 2017 RPN Programming contest information and results thread
|
09-15-2017, 11:00 PM
Post: #1
|
|||
|
|||
HHC 2017 RPN Programming contest information and results thread
Hello all. The PDF of the programming contest is attached below.
Please work on this problem and do not post RESULTS of your work until after 6pm Nashville CDT on Sunday. Questions here are fine, but please try not to give away how you are approaching the problem with your question. Ask carefully. I hope you enjoy the problem. Happy programming! |
|||
09-15-2017, 11:15 PM
Post: #2
|
|||
|
|||
RE: HHC 2017 RPN Programming contest information and results thread
Interesting. I like the happy numbers.
Pauli |
|||
09-16-2017, 09:27 AM
Post: #3
|
|||
|
|||
RE: HHC 2017 RPN Programming contest information and results thread
Stayed up too late prior to start of conference working on the contests. My RPN prog is currently 70 bytes, needs no registers (just stack and alpha). I will need to ask Gene to clarify a question about the output formt.
|
|||
09-16-2017, 09:48 AM
(This post was last modified: 09-16-2017 07:26 PM by Didier Lachieze.)
Post: #4
|
|||
|
|||
RE: HHC 2017 RPN Programming contest information and results thread
My current RPN program is 65 bytes including 1 register (7 bytes).
EDIT: down to 62 bytes after a few changes. EDIT 2: I forget rule 6 and need to add 9 bytes for LBL HAPPY... So with a few optimizations it's now at 70 bytes including the END instruction. EDIT 3: well, after following all the rules (I hope so) I'm at 75 bytes, with a program starting with LBL HAPPY and restoring all defaults settings before ending with a regular END. |
|||
09-16-2017, 04:08 PM
Post: #5
|
|||
|
|||
RE: HHC 2017 RPN Programming contest information and results thread
76 bytes (according to RCLPTA) and no storage registers.
If we don't use any storage registers, is including SIZE 00 mandatory, or can SIZE be omitted entirely? |
|||
09-16-2017, 04:54 PM
(This post was last modified: 09-16-2017 06:11 PM by brouhaha.)
Post: #6
|
|||
|
|||
RE: HHC 2017 RPN Programming contest information and results thread
Found a bug in my program. Was afraid it would get bigger, but with fix and some more optimization, I'm down to 68 bytes and 0 registers. At the moment I don't have any great ideas for shaving off more bytes.
CORRECTION! Gene just told me that he reversed a decision I wrote about here previously. Rule 11 of the RPN contest DOES apply. "Your program must stop with the default settings in place." Unfortunately that does increase the size of my program again. Also, Gene said that the program output has to match the example output EXACTLY. If the program output looks different than the examples, it will be considered to FAIL. For example, he said that an output of "HAPPY 4.0000" is not accepted. |
|||
09-16-2017, 06:22 PM
Post: #7
|
|||
|
|||
RE: HHC 2017 RPN Programming contest information and results thread
yes, Eric is correct. My apologies.
Default settings should be restored when a program ends. If Flag 0 is clear by default and you need to set flag 0 for some reason, when the program halts, be sure that you have cleared flag 0 again. Also, as Eric says, if the sample output shows HAPPY 4, then do not show Happy 4. or Happy 4.00 etc. I hope everyone is enjoying the challenge! |
|||
09-16-2017, 06:29 PM
Post: #8
|
|||
|
|||
RE: HHC 2017 RPN Programming contest information and results thread
Thanks for the challenge Gene! I wish I were with all of you at the HHC.
One point in the contest is not clear for me, if the program ends with RTN do we have to count any END that may be after it ? Or can we rely on the .END. at the end of program memory without including it in the byte-count ? |
|||
09-16-2017, 06:35 PM
Post: #9
|
|||
|
|||
RE: HHC 2017 RPN Programming contest information and results thread
End a program with a 3-byte regular END.
|
|||
09-16-2017, 08:37 PM
Post: #10
|
|||
|
|||
RE: HHC 2017 RPN Programming contest information and results thread
My prog is at 72 bytes w/ initial label, restoration to default state, and END. I don't think I'll stare at it any longer, as all my recent ideas for shortening it have either left the byte count unchanged, or actually increased. Maybe I can find some improvements to my RPL contest entry instead.
|
|||
09-16-2017, 10:16 PM
(This post was last modified: 09-16-2017 11:10 PM by Gene.)
Post: #11
|
|||
|
|||
RE: HHC 2017 RPN Programming contest information and results thread
EDITED EDITED...
Keep the LBL HAPPY for the start of the program. MY apologies. Too many things going on doing this and the live conference. Sorry all! ALSO a clarification on the SIZE XYZ aspect. That is meant to mean that if you use a register, it will add 7 bytes to your byte count. If you store values into 3 memories, that's 3x7 or 21 bytes to your count. A byte count cost of 7 bytes/register used will be assessed whether you have to change the default SIZE setting or not. |
|||
09-17-2017, 03:50 PM
Post: #12
|
|||
|
|||
RE: HHC 2017 RPN Programming contest information and results thread
Late to the party and still no happiness.
I tried it on the HP-42S first, avoiding its specific instructions. 66+ 7 bytes (1 register) on the 41CX. Too bad it won't work as expected without the Advantage ROM. I didn't know AIP wasn't a standard 41CX instruction. Looking forward to all valid solutions. Gerson. |
|||
09-17-2017, 04:09 PM
Post: #13
|
|||
|
|||
RE: HHC 2017 RPN Programming contest information and results thread
I'm at 70 bytes, no storage registers, and I don't think I'll be able to squeeze it down any more than that.
|
|||
09-17-2017, 05:38 PM
(This post was last modified: 09-17-2017 08:01 PM by Werner.)
Post: #14
|
|||
|
|||
RE: HHC 2017 RPN Programming contest information and results thread
Edited: 71 bytes including END, no registers used.
Werner 41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE |
|||
09-17-2017, 10:42 PM
Post: #15
|
|||
|
|||
RE: HHC 2017 RPN Programming contest information and results thread
OK I will break the ice. Here's my entry from Nashville. See attachment, I don't want to put it into the message itself.
It's not the highest byte count and not the lowest byte count. I think it works, but would be first to say it is far from both optimum and elegant. 82 bytes, no registers. I would like to see other solutions. |
|||
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:
|
|||
09-18-2017, 12:51 AM
Post: #17
|
|||
|
|||
RE: HHC 2017 RPN Programming contest information and results thread
Well, I got it to 70 bytes, but we found some edge cases it choked on (0 cycles). Changing the position of one instruction fixes it, without affecting the size. Here's the fixed version for anybody that wants to vastly outdo me.
Code: LBL "HAPPY" |
|||
09-18-2017, 03:05 AM
(This post was last modified: 09-18-2017 03:19 AM by Didier Lachieze.)
Post: #18
|
|||
|
|||
RE: HHC 2017 RPN Programming contest information and results thread
Aha.... I didn't think using ATOX for the digit extraction, shame on me.
So here is my program in 75 bytes (68 + 7 for register 00). The good thing is that it works on the 41C without any module. Code: Step Bytes Instruction And here is a solution in 69 bytes using ATOX: Code: Step Bytes Instruction |
|||
09-18-2017, 04:27 AM
Post: #19
|
|||
|
|||
RE: HHC 2017 RPN Programming contest information and results thread
Here's my entry. 75 bytes (according to Free42) using 41C instructions and no storage registers.
Code: 01 LBL "HAPPY" |
|||
09-18-2017, 05:36 AM
Post: #20
|
|||
|
|||
RE: HHC 2017 RPN Programming contest information and results thread
71 bytes, no regs
Code: 01>LBL"HAPPY" Cheers, Werner 41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 5 Guest(s)