Post Reply 
2024 HHC Programming Contest - RPN #1
09-23-2024, 11:39 AM
Post: #21
RE: 2024 HHC Programming Contest - RPN #1
I had:

1) LBLA 7 Enter 7 / 7 + Enter Enter + + END
2) LBLA Sigma+ Sigma+ Sigma+ Enter 7 + 7 + 7 + END
Find all posts by this user
Quote this message in a reply
09-23-2024, 12:02 PM
Post: #22
RE: 2024 HHC Programming Contest - RPN #1
(09-23-2024 11:04 AM)Gene Wrote:  Here are the solutions from the conference:

12 bytes:
...
LBL A 7 Sigma+ 7 Sigma+ 7 Sigma+ RCL 11 END

How is this supposed to work?
Some instruction missed in the listing (but still 12 bytes listed)?
On a MC 41 I only get 21 (7*3) into X ...

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
09-23-2024, 12:29 PM
Post: #23
RE: 2024 HHC Programming Contest - RPN #1
And BTW ...

(09-23-2024 11:04 AM)Gene Wrote:  Is there an 11 byte solution given the LBL A and END ?

Here is one I just found ... Wink

Code:
LBL A   2
777     3
PI      1
%       1
INT     1
END     3
6 lines 11 bytes

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
09-23-2024, 12:33 PM
Post: #24
RE: 2024 HHC Programming Contest - RPN #1
(09-23-2024 11:04 AM)Gene Wrote:  What I love are the wide varieties of the solutions. P->R ? OCT ? :-)

We can’t do without PI ! Here’s my solution in 12 bytes :
Code:
001 LBL A
002 777
003 SQRT
004 PI
005 -
006 INT
007 END
Find all posts by this user
Quote this message in a reply
09-23-2024, 12:33 PM
Post: #25
RE: 2024 HHC Programming Contest - RPN #1
(09-23-2024 12:02 PM)ThomasF Wrote:  
(09-23-2024 11:04 AM)Gene Wrote:  LBL A 7 Sigma+ 7 Sigma+ 7 Sigma+ RCL 11 END

How is this supposed to work?

Obviously a missing + at the end, making 13 bytes total.
Also " LBL A COS ATAN 7 - 7 - 7 - END " is 13 bytes long.

BTW, my solution was
LBL A 77.7 LN INT FACT END
close the last listed solution of the conference's results.

J-F
Visit this user's website Find all posts by this user
Quote this message in a reply
09-23-2024, 12:35 PM
Post: #26
RE: 2024 HHC Programming Contest - RPN #1
(09-23-2024 12:29 PM)ThomasF Wrote:  Here is one I just found ... Wink

Code:
LBL A   2
777     3
PI      1
%       1
INT     1
END     3
6 lines 11 bytes

Wonderful !
Find all posts by this user
Quote this message in a reply
09-23-2024, 12:37 PM
Post: #27
RE: 2024 HHC Programming Contest - RPN #1
(09-23-2024 12:33 PM)J-F Garnier Wrote:  Obviously a missing + at the end, making 13 bytes total.

Hi J-F,

Yes, thought so too, but Sigma+ doesn't enable stacklift, so after RCL 11 Y is still 0.
So, there must be both a ENTER and a + missing to make it work ... i.e. 14 bytes in total.

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
09-23-2024, 01:01 PM
Post: #28
RE: 2024 HHC Programming Contest - RPN #1
(09-23-2024 12:35 PM)Didier Lachieze Wrote:  
(09-23-2024 12:29 PM)ThomasF Wrote:  Here is one I just found ... Wink

Code:
LBL A   2
777     3
PI      1
%       1
INT     1
END     3
6 lines 11 bytes

Wonderful !

Really amazing, congrats Thomas !

Now, what if using only integer arithmetic?
We already have this 13-byte solution:
LBL A 7 ENTER 7 + 7 ÷ x^2 FACT END

J-F
Visit this user's website Find all posts by this user
Quote this message in a reply
09-23-2024, 01:29 PM
Post: #29
RE: 2024 HHC Programming Contest - RPN #1
(09-23-2024 01:01 PM)J-F Garnier Wrote:  
(09-23-2024 12:35 PM)Didier Lachieze Wrote:  Wonderful !

Really amazing, congrats Thomas !

Now, what if using only integer arithmetic?
We already have this 13-byte solution:
LBL A 7 ENTER 7 + 7 ÷ x^2 FACT END

J-F

Thanks J-F Wink

Challenge taken! My first attempt is:

LBL A 77 DEC LASTx + 7 / OCT END

But also counts down to 13 bytes, but there is probably more ways to do it ...

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
09-23-2024, 01:46 PM
Post: #30
RE: 2024 HHC Programming Contest - RPN #1
(09-23-2024 01:01 PM)J-F Garnier Wrote:  We already have this 13-byte solution:
LBL A 7 ENTER 7 + 7 ÷ x^2 FACT END

J-F

And now ... a 12 byte version ... Wink

LBL A 77 X² OCT 7 MOD FACT END

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
09-23-2024, 04:00 PM
Post: #31
RE: 2024 HHC Programming Contest - RPN #1
(09-23-2024 12:37 PM)ThomasF Wrote:  
(09-23-2024 12:33 PM)J-F Garnier Wrote:  Obviously a missing + at the end, making 13 bytes total.

Hi J-F,

Yes, thought so too, but Sigma+ doesn't enable stacklift, so after RCL 11 Y is still 0.
So, there must be both a ENTER and a + missing to make it work ... i.e. 14 bytes in total.

Cheers,
Thomas

Bravo ThomasF! PI percents of something... sounds crazy but it did the job.
Find all posts by this user
Quote this message in a reply
09-23-2024, 09:03 PM (This post was last modified: 09-23-2024 09:03 PM by badaze.)
Post: #32
RE: 2024 HHC Programming Contest - RPN #1
(09-23-2024 11:04 AM)Gene Wrote:  Here are the solutions from the conference:

16 bytes:

LBL A CLΣ Σ+ Σ+ Σ+ ENTER 7 + 7 + 7 + END

I was about to post almost the same code…

My site http://www.emmella.fr
Find all posts by this user
Quote this message in a reply
09-23-2024, 10:58 PM
Post: #33
RE: 2024 HHC Programming Contest - RPN #1
My two versions on PX-41CX

Code:
001    LBL A          CF 66
002    7              17 00
003    7              17 00
004    7              17 
005    +              40
006    +              40
007    PI             72
008    +              40
009    INT            68
010    STOP           84
011    END            C0 00 2F

Code:
001    LBL A          CF 66
002    7              17 00
003    77             17 17 
004    PI             72
005    /              43
006    INT            68
007    STOP           84
008    END            C0 00 2F

http://ti58c.phweb.me
http://clones.phweb.me
http://www.instagram.com/ti58c
"No! Do or Do not. There is no try!" [Master Yoda]
Visit this user's website Find all posts by this user
Quote this message in a reply
09-23-2024, 11:06 PM (This post was last modified: 09-23-2024 11:07 PM by Paul Dale.)
Post: #34
RE: 2024 HHC Programming Contest - RPN #1
My best entry is:

Code:

001 LBL A
002 7.77
003 PI
004 *
005 INT
006 END
Find all posts by this user
Quote this message in a reply
09-24-2024, 01:42 AM (This post was last modified: 09-24-2024 09:03 AM by Paul Dale.)
Post: #35
RE: 2024 HHC Programming Contest - RPN #1
My other attempts being:

Code:

001 LBL A
002 7
003 x^2
004 7
005 ENTER
006 +
007 7
008 /
009 /
010 INT
011 END

Code:

001 LBL A
002 7
003 sigma+
004 7
005 sigma+
006 7
007 sigma+
008 RCL+11      not on a 41C though
009 END

This one edited to correct mistake:
Code:

001 LBL A
002 777
003 LN
004 INT
005 ENTER
006 +
007 ENTER
008 +
009 END
Find all posts by this user
Quote this message in a reply
09-24-2024, 06:08 AM
Post: #36
RE: 2024 HHC Programming Contest - RPN #1
(09-24-2024 01:42 AM)Paul Dale Wrote:  
Code:

001 LBL A
002 777
003 LN
004 ENTER
005 +
006 ENTER
007 +
008 INT
009 END

Should the INT not be before the first ENTER, straight after LN?

ln(777) ≈ 6.655..... so your program gives 26 instead of 24.

int(ln(777)) = 6

Current daily drivers: HP-41CL, HP-15C, HP-16C
Find all posts by this user
Quote this message in a reply
09-24-2024, 09:02 AM
Post: #37
RE: 2024 HHC Programming Contest - RPN #1
Yes, transcription error on my part.

Pauli
Find all posts by this user
Quote this message in a reply
09-24-2024, 12:31 PM (This post was last modified: 09-24-2024 12:40 PM by AnnoyedOne.)
Post: #38
RE: 2024 HHC Programming Contest - RPN #1
(09-23-2024 11:06 PM)Paul Dale Wrote:  My best entry is:

Nice Paul! It even works in my HP 25 (PC) emulator. The 25 doesn't implement labels but the 29C does (0-9).

Code:

g LBL 0
7
.
7
7
g pi
*
f INT
g RTN

9 steps/bytes, I think, in my 29C emulator.

A1

HP-15C (2234A02xxx), HP-16C (2403A02xxx), HP-15C CE (9CJ323-03xxx), HP-20S (2844A16xxx), HP-12C+ (9CJ251)

Find all posts by this user
Quote this message in a reply
09-24-2024, 03:47 PM
Post: #39
RE: 2024 HHC Programming Contest - RPN #1
(09-23-2024 12:02 PM)ThomasF Wrote:  
(09-23-2024 11:04 AM)Gene Wrote:  Here are the solutions from the conference:

12 bytes:
...
LBL A 7 Sigma+ 7 Sigma+ 7 Sigma+ RCL 11 END

How is this supposed to work?
Some instruction missed in the listing (but still 12 bytes listed)?
On a MC 41 I only get 21 (7*3) into X ...

Cheers,
Thomas
Indeed there was one additional instruction. Another Sigma+ before RCL11 that would give 24, but 13 bytes also of course.

Günter
Find all posts by this user
Quote this message in a reply
09-24-2024, 03:55 PM
Post: #40
RE: 2024 HHC Programming Contest - RPN #1
(09-23-2024 09:03 PM)badaze Wrote:  
(09-23-2024 11:04 AM)Gene Wrote:  Here are the solutions from the conference:

16 bytes:

LBL A CLΣ Σ+ Σ+ Σ+ ENTER 7 + 7 + 7 + END

I was about to post almost the same code…

The CLΣ is superfluous as the condition was a clear state of the calculator.

Günter
Find all posts by this user
Quote this message in a reply
Post Reply 




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