Post Reply 
2023 RPN HHC Programming Contest
10-09-2023, 05:27 AM
Post: #41
RE: 2023 RPN HHC Programming Contest
Hi all,

I had a little different approach for my first attempt:
Code:
 01 LBL "HHC"
 02 10^X        1
 03 ENTER^      1       1
 04 10^X        10      1
 05 ST+ Y       10      11
 06 PI          3.14    10      11
 07 INT         3       10      11
 08 *           30      11
 09 STO Z       30      11      30
 10 +           41      30
 11 ST+ Y       41      71
 12 END

That ended up to 23 bytes all together, but also relies on that X == 0 as input.

My second attempt was then instead:

Code:
 01 LBL "HHC"
 02 PI          3.14
 03 1/X         0.31
 04 ACOS        71.4
 05 INT         71
 06 STO Y       71      71
 07 PI          3.14    71      71
 08 SQRT        1.77    71      71
 09 /           40.05   71
 10 INT         40      71
 11 ISG X       41      71
 12 END

Ended up on 12 lines, 22 bytes and no requirements on the stack or input.

Thanks for a funny challenge and great to see all nice solutions!

RPN rules! 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
Post Reply 


Messages In This Thread
2023 RPN HHC Programming Contest - Gene - 10-07-2023, 01:00 PM
RE: 2023 RPN HHC Programming Contest - ThomasF - 10-09-2023 05:27 AM



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