Post Reply 
2023 RPN HHC Programming Contest
10-07-2023, 01:00 PM (This post was last modified: 10-07-2023 01:01 PM by Gene.)
Post: #1
2023 RPN HHC Programming Contest
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.


Attached File(s)
.pdf  HHC 2023 RPN Programming Contest.pdf (Size: 60.41 KB / Downloads: 203)
Find all posts by this user
Quote this message in a reply
10-07-2023, 08:44 PM
Post: #2
RE: 2023 RPN HHC Programming Contest
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.
Find all posts by this user
Quote this message in a reply
10-07-2023, 09:24 PM (This post was last modified: 10-07-2023 09:25 PM by Didier Lachieze.)
Post: #3
RE: 2023 RPN HHC Programming Contest
(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.
Find all posts by this user
Quote this message in a reply
10-07-2023, 11:01 PM (This post was last modified: 10-08-2023 01:31 AM by Gerson W. Barbosa.)
Post: #4
RE: 2023 RPN HHC Programming Contest
16 steps including LBL and END, 24 bytes.
Too many bytes! Have to cut a few…

—-

15 steps, 23 bytes. Still too many bytes…
Find all posts by this user
Quote this message in a reply
10-07-2023, 11:12 PM
Post: #5
RE: 2023 RPN HHC Programming Contest
(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.

Can we use the digit keys to generate instructions that don’t show any digits?

By what I have understood no digits should appear in the listing, except of course for line numbers.
Find all posts by this user
Quote this message in a reply
10-08-2023, 06:39 AM
Post: #6
RE: 2023 RPN HHC Programming Contest
(10-07-2023 11:01 PM)Gerson W. Barbosa Wrote:  16 steps including LBL and END, 24 bytes.
Too many bytes! Have to cut a few…

—-

15 steps, 23 bytes. Still too many bytes…

6 steps, 19 bytes.
Find all posts by this user
Quote this message in a reply
10-08-2023, 08:15 AM
Post: #7
RE: 2023 RPN HHC Programming Contest
(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 ... Wink

Cheers,
Thomas

[35/45/55/65/67/97/80 21/25/29C 31E/32E/33E|C/34C/38E 41C|CV|CX 71B 10C/11C/12C/15C|CE/16C 32S|SII/42S 28C|S 48GX/49G/50G 35S 41X]
Find all posts by this user
Quote this message in a reply
10-08-2023, 11:43 AM
Post: #8
RE: 2023 RPN HHC Programming Contest
(10-08-2023 08:15 AM)ThomasF Wrote:  
(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 ... Wink

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.
Find all posts by this user
Quote this message in a reply
10-08-2023, 11:48 AM
Post: #9
RE: 2023 RPN HHC Programming Contest
(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.
Find all posts by this user
Quote this message in a reply
10-08-2023, 11:55 AM (This post was last modified: 10-08-2023 12:47 PM by Ajaja.)
Post: #10
RE: 2023 RPN HHC Programming Contest
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).
Find all posts by this user
Quote this message in a reply
10-08-2023, 01:08 PM
Post: #11
RE: 2023 RPN HHC Programming Contest
(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.

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.


No digits can show on a program line other than the line number.

No FIX 0, etc. are allowed. :-)
Find all posts by this user
Quote this message in a reply
10-08-2023, 01:28 PM (This post was last modified: 10-08-2023 01:29 PM by ThomasF.)
Post: #12
RE: 2023 RPN HHC Programming Contest
(10-08-2023 01:08 PM)Gene Wrote:  No digits can show on a program line other than the line number.

No FIX 0, etc. are allowed. :-)

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

[35/45/55/65/67/97/80 21/25/29C 31E/32E/33E|C/34C/38E 41C|CV|CX 71B 10C/11C/12C/15C|CE/16C 32S|SII/42S 28C|S 48GX/49G/50G 35S 41X]
Find all posts by this user
Quote this message in a reply
10-08-2023, 01:47 PM
Post: #13
RE: 2023 RPN HHC Programming Contest
(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.)
Find all posts by this user
Quote this message in a reply
10-08-2023, 01:49 PM
Post: #14
RE: 2023 RPN HHC Programming Contest
(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.
Find all posts by this user
Quote this message in a reply
10-08-2023, 02:07 PM
Post: #15
RE: 2023 RPN HHC Programming Contest
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 :-)
Find all posts by this user
Quote this message in a reply
10-08-2023, 02:15 PM (This post was last modified: 10-08-2023 02:26 PM by Gerson W. Barbosa.)
Post: #16
RE: 2023 RPN HHC Programming Contest
(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).

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?

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.
Find all posts by this user
Quote this message in a reply
10-08-2023, 02:35 PM
Post: #17
RE: 2023 RPN HHC Programming Contest
(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.

Remember, we all want to learn and have fun :-)

Thanks a lot!
As long as the rules are clear and for sure I have enjoyed the challenge ... Wink

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 ... Wink

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

[35/45/55/65/67/97/80 21/25/29C 31E/32E/33E|C/34C/38E 41C|CV|CX 71B 10C/11C/12C/15C|CE/16C 32S|SII/42S 28C|S 48GX/49G/50G 35S 41X]
Find all posts by this user
Quote this message in a reply
10-08-2023, 02:57 PM
Post: #18
RE: 2023 RPN HHC Programming Contest
(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.

Remember, we all want to learn and have fun :-)

Thanks a lot!
As long as the rules are clear and for sure I have enjoyed the challenge ... Wink

Cheers,
Thomas


Gene: Hence my apologies. :-) Sorry all !
Find all posts by this user
Quote this message in a reply
10-08-2023, 02:58 PM (This post was last modified: 10-08-2023 03:03 PM by Ajaja.)
Post: #19
RE: 2023 RPN HHC Programming Contest
Code:
You may not use the EEX key.
Oops...
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.
Find all posts by this user
Quote this message in a reply
10-08-2023, 03:19 PM
Post: #20
RE: 2023 RPN HHC Programming Contest
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.)
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




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