HHC 2017 RPN Programming contest information and results thread - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: General Forum (/forum-4.html) +--- Thread: HHC 2017 RPN Programming contest information and results thread (/thread-9084.html) |
HHC 2017 RPN Programming contest information and results thread - Gene - 09-15-2017 11:00 PM 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! RE: HHC 2017 RPN Programming contest information and results thread - Paul Dale - 09-15-2017 11:15 PM Interesting. I like the happy numbers. Pauli RE: HHC 2017 RPN Programming contest information and results thread - brouhaha - 09-16-2017 09:27 AM 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. RE: HHC 2017 RPN Programming contest information and results thread - Didier Lachieze - 09-16-2017 09:48 AM 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. RE: HHC 2017 RPN Programming contest information and results thread - Dave Britten - 09-16-2017 04:08 PM 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? RE: HHC 2017 RPN Programming contest information and results thread - brouhaha - 09-16-2017 04:54 PM 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. RE: HHC 2017 RPN Programming contest information and results thread - Gene - 09-16-2017 06:22 PM 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! RE: HHC 2017 RPN Programming contest information and results thread - Didier Lachieze - 09-16-2017 06:29 PM 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 ? RE: HHC 2017 RPN Programming contest information and results thread - Gene - 09-16-2017 06:35 PM End a program with a 3-byte regular END. RE: HHC 2017 RPN Programming contest information and results thread - brouhaha - 09-16-2017 08:37 PM 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. RE: HHC 2017 RPN Programming contest information and results thread - Gene - 09-16-2017 10:16 PM 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. RE: HHC 2017 RPN Programming contest information and results thread - Gerson W. Barbosa - 09-17-2017 03:50 PM 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. RE: HHC 2017 RPN Programming contest information and results thread - Dave Britten - 09-17-2017 04:09 PM 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. RE: HHC 2017 RPN Programming contest information and results thread - Werner - 09-17-2017 05:38 PM Edited: 71 bytes including END, no registers used. Werner RE: HHC 2017 RPN Programming contest information and results thread - DanM - 09-17-2017 10:42 PM 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. RE: HHC 2017 RPN Programming contest information and results thread - Gerson W. Barbosa - 09-17-2017 11:51 PM 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:
RE: HHC 2017 RPN Programming contest information and results thread - Dave Britten - 09-18-2017 12:51 AM 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" RE: HHC 2017 RPN Programming contest information and results thread - Didier Lachieze - 09-18-2017 03:05 AM 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 RE: HHC 2017 RPN Programming contest information and results thread - David Hayden - 09-18-2017 04:27 AM Here's my entry. 75 bytes (according to Free42) using 41C instructions and no storage registers. Code: 01 LBL "HAPPY" RE: HHC 2017 RPN Programming contest information and results thread - Werner - 09-18-2017 05:36 AM 71 bytes, no regs Code: 01>LBL"HAPPY" Cheers, Werner |