Post Reply 
2023 RPN HHC Programming Contest
10-26-2023, 08:07 PM
Post: #66
RE: 2023 RPN HHC Programming Contest
(10-23-2023 06:51 PM)David Hayden Wrote:  Here's my 3rd place entry at 25 bytes.
Code:
01 LBL "HHC"
02 ∑+
03 ENTER↑
04 10↑X
05 ENTER↑
06 ∑+
07 1/X
08 ACOS
09 LASTX
10 ASIN
11 RDN
12 +
13 +
14 ENTER↑
15 R↑
16 -
17 END
I love these contests. It's fun to do them at the conference, but the really great part is seeing how the forum always comes up with a much better solution. Many thanks to Gene for creating and judging them.

Thank you for posting your code. It’s always interesting to see the various approaches to the problem. My first attempt was also 25-byte and 17-step long, based on an easy to find approximation, which was subsequently reduced to the 24-byte 16-step one I first mentioned. I remember having used both ∑+ and ∑- in a past contest, when it was already over, I think.
Trying these at home with lots of free time is quite a different thing than solving them at the conference while participating in various activities, though.
Just for the record, before I throw away my notes, I will leave below my first two attempts.
Also, I tried a small variation on Gene’s challenge. Instead of placing 71 and 41 on the stack, I thought of displaying just a single constant, 7141. I imagined it could be done using fewer steps, but I didn’t find anything shorter than 13 steps on the 41C (or 18 bytes and 12 steps on the HP-42S, by loosening the rules to allow a 42S-specific feature, but not ATOX).

Best regards,

Gerson.

——

Code:


 01 LBL "HHC"
 02 PI
 03 SQRT
 04 LASTX
 05 E^X
 06 *
 07 INT
 08 PI
 09 INT
 10 SQRT
 11 X<>Y
 12 *
 13 LASTX
 14 X<>Y
 15 INT
 16 X<>Y
 17 END

25 bytes

Code:


 01 LBL "HHC"
 02 PI
 03 INT
 04 SQRT
 05 PI
 06 E^X
 07 LASTX
 08 SQRT
 09 *
 10 *
 11 LASTX
 12 X<>Y
 13 INT
 14 X<>Y
 15 INT
 16 END 

24 bytes
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
2023 RPN HHC Programming Contest - Gene - 10-07-2023, 01:00 PM
RE: 2023 RPN HHC Programming Contest - Gerson W. Barbosa - 10-26-2023 08:07 PM



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