2023 RPN HHC Programming Contest - 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: 2023 RPN HHC Programming Contest (/thread-20599.html) |
2023 RPN HHC Programming Contest - Gene - 10-07-2023 01:00 PM Please DO NOT POST solutions until after 6pm EASTERN USA TIME Sunday Evening 10/8/2023. Note: The digit keys may not be pressed in any combination of functions in your program - OTHER than pressing SHIFT 4 (BEEP) should you decide to use BEEP in your program... STO 04 would not be allowed but Shift 4 would be. RE: 2023 RPN HHC Programming Contest - Gene - 10-07-2023 08:44 PM Answer to a question here at the conference: Programs should not show any digits in any program instructions. That means no STO 07 or RCL 12 either. The decimal point is also not allowed. RE: 2023 RPN HHC Programming Contest - Didier Lachieze - 10-07-2023 09:24 PM (10-07-2023 08:44 PM)Gene Wrote: Programs should not show any digits in any program instructions. That means no STO 07 or RCL 12 either. The decimal point is also not allowed. Can we use the digit keys to generate instructions that don’t show any digits? You mentioned Shift 4 to generate BEEP but there are others instructions not including a digit which need to press some of the digit keys to be created. RE: 2023 RPN HHC Programming Contest - Gerson W. Barbosa - 10-07-2023 11:01 PM 16 steps including LBL and END, 24 bytes. Too many bytes! Have to cut a few… —- 15 steps, 23 bytes. Still too many bytes… RE: 2023 RPN HHC Programming Contest - Gerson W. Barbosa - 10-07-2023 11:12 PM (10-07-2023 09:24 PM)Didier Lachieze Wrote:(10-07-2023 08:44 PM)Gene Wrote: Programs should not show any digits in any program instructions. That means no STO 07 or RCL 12 either. The decimal point is also not allowed. By what I have understood no digits should appear in the listing, except of course for line numbers. RE: 2023 RPN HHC Programming Contest - Didier Lachieze - 10-08-2023 06:39 AM (10-07-2023 11:01 PM)Gerson W. Barbosa Wrote: 16 steps including LBL and END, 24 bytes. 6 steps, 19 bytes. RE: 2023 RPN HHC Programming Contest - ThomasF - 10-08-2023 08:15 AM (10-08-2023 06:39 AM)Didier Lachieze Wrote: 6 steps, 19 bytes. Nice! I was down to 12 lines (LBL and END included) but must obviously find another angle of attack ... Cheers, Thomas RE: 2023 RPN HHC Programming Contest - Wes Loewer - 10-08-2023 11:43 AM (10-08-2023 08:15 AM)ThomasF Wrote:(10-08-2023 06:39 AM)Didier Lachieze Wrote: 6 steps, 19 bytes. Same here. I was down to 13 steps. The only way I can think of getting 6 steps is to use the ATOX command which was not on the 41C. Back to the drawing board for me. RE: 2023 RPN HHC Programming Contest - Didier Lachieze - 10-08-2023 11:48 AM (10-08-2023 11:43 AM)Wes Loewer Wrote: The only way I can think of getting 6 steps is to use the ATOX command which was not on the 41C. You’re right, it’s not a valid solution, so back to the drawing board for me too. RE: 2023 RPN HHC Programming Contest - Ajaja - 10-08-2023 11:55 AM I have 12 lines with LBL and END too (assuming default machine settings after a master clear). P.S. But if I can't use commands with digits in listing like 1/x or 10^x then 13 lines (assuming a clear stack). RE: 2023 RPN HHC Programming Contest - Gene - 10-08-2023 01:08 PM (10-07-2023 09:24 PM)Didier Lachieze Wrote:(10-07-2023 08:44 PM)Gene Wrote: Programs should not show any digits in any program instructions. That means no STO 07 or RCL 12 either. The decimal point is also not allowed. No digits can show on a program line other than the line number. No FIX 0, etc. are allowed. :-) RE: 2023 RPN HHC Programming Contest - ThomasF - 10-08-2023 01:28 PM (10-08-2023 01:08 PM)Gene Wrote: No digits can show on a program line other than the line number. Just to be clear - you mean NO digits what so ever are allowed to be shown in the program listing, i.e. x^2 or 1/x are NOT allowed (ONLY the line number is allowed to contain digits). Cheers, Thomas RE: 2023 RPN HHC Programming Contest - Wes Loewer - 10-08-2023 01:47 PM (10-08-2023 11:55 AM)Ajaja Wrote: P.S. But if I can't use commands with digits in listing like 1/x or 10^x then 13 lines (assuming a clear stack). Surely "no digits" does not refer to the command names themselves? That would also eliminate x^2, ln1+x, e^x-1. Or was this the intention? Quote:The decimal point is also not allowed.Using the same logic would imply no indirects as well. (I'm down to 12 steps.) RE: 2023 RPN HHC Programming Contest - C.Ret - 10-08-2023 01:49 PM (10-08-2023 11:55 AM)Ajaja Wrote: I have 12 lines with LBL and END too (assuming default machine settings after a master clear). We must have a fairly similar code, I also arrive at 12 lines of programs counting for 26 bytes. I am considering adding a 13th line at the beginning to clear the stack since it is state to take no input. This brings the total to 27 bytes (including 10 bytes for the LBL"HHC and the END). I have already spent too much time and this will be my optimal code. My other codes are illegal given the clarifications made to the rule and have even more bytes... At least my code produces the following stack: T: 0 Z: 0 Y: 71 X: 41 L: 1. Anyway thank you for sharing this contest, it's always fun trying to solve it in real time. Congratulations to the HHC participants who manage to do this well while following and participating in meetings at the same time. RE: 2023 RPN HHC Programming Contest - Gene - 10-08-2023 02:07 PM STO 05, FIX 4, etc. are not allowed because to enter them you must press a digit key which then shows the digit in the display. 1/x, 10^x, x^2, etc. if you wish ARE allowed because you did not need to press the digit keys to enter a digit in the display. STO 05 by pressing STO LN is also not allowed. Use the stack. Sorry... really not trying to make this tough, just wanting old fashioned efficient stack usage and to challenge getting a couple of specific numbers without using digit keys to help out. Remember, we all want to learn and have fun :-) RE: 2023 RPN HHC Programming Contest - Gerson W. Barbosa - 10-08-2023 02:15 PM (10-08-2023 01:47 PM)Wes Loewer Wrote:(10-08-2023 11:55 AM)Ajaja Wrote: P.S. But if I can't use commands with digits in listing like 1/x or 10^x then 13 lines (assuming a clear stack). The original rules stated that “You may not use any of the digit keys 0, 1, 2, 3, 4, 5, 6, 7, 8 or 9.” In principle this would prevent BEEP (shifted 4), for instance, from being used, hence Gene’s further clarification. No digits but line numbers showing in the lines was my interpretation, which I realize now is even more restrictive than the shifted functions associated with the digits 0-9. So far I haven’t used any function with digits in the name, like 1/x and x^2, but I think it would be fair to use them per the original rules. P.S.: This matter has been already clarified by Gene in the previous post. Sorry for the confusion. RE: 2023 RPN HHC Programming Contest - ThomasF - 10-08-2023 02:35 PM (10-08-2023 02:07 PM)Gene Wrote: Sorry... really not trying to make this tough, just wanting old fashioned efficient stack usage and to challenge getting a couple of specific numbers without using digit keys to help out. Thanks a lot! As long as the rules are clear and for sure I have enjoyed the challenge ... I'm down to 22 bytes in total according to CAT 1. 12 lines in total including the LBL "HHC" and END, with 10 bytes for the LBL and END, and 12 bytes for the actual program. And no digits at all apart from the '1/x' instruction I used ... I don't assume a clear stack (but L, X, Z and T are lost, and Y is preserved in Z and T). When executing the routine I end up with a stack looking like this: XEQ "HHC" T: 0 (actually old Y value) Z: 0 (actually old Y value) Y: 71 X: 41 L: 40.0575 Cheers, Thomas RE: 2023 RPN HHC Programming Contest - Gene - 10-08-2023 02:57 PM (10-08-2023 02:35 PM)ThomasF Wrote:(10-08-2023 02:07 PM)Gene Wrote: Sorry... really not trying to make this tough, just wanting old fashioned efficient stack usage and to challenge getting a couple of specific numbers without using digit keys to help out. Gene: Hence my apologies. :-) Sorry all ! RE: 2023 RPN HHC Programming Contest - Ajaja - 10-08-2023 02:58 PM Code: You may not use the EEX key. Assuming HP-41C with broken keyboard without keys 0-9 and EEX (for "P" in alpha mode, e.g.), it wouldn't be possible to enter my solution. So, maybe it's not valid after all. RE: 2023 RPN HHC Programming Contest - Eddie W. Shore - 10-08-2023 03:19 PM I hope that INT (integer part(IP)) is allowable, because on the 41C, spelling INT requires a press of the 9 key. (Those who are using the 42S, 32S, 15C, 12C, etc. would not have a problem.) |