Post Reply 
HHC 2022 - Programming Contest - no responses until after 6am Monday 6am CENTRAL
09-16-2022, 12:19 PM (This post was last modified: 09-16-2022 12:32 PM by C.Ret.)
Post: #42
RE: HHC 2022 - Programming Contest - no responses until after 6am Monday 6am CENTRAL
Hi there,

At the moment, I'm not parting with my SHARP EL-5150 calculator, and so here's what I would have returned to Gene if I had been able to attend this year's meeting in person.

   

Of course, I would have been immediately disqualified, it's not even an American machine.

Here is the code it would have contained:
I have deliberately added spaces and line breaks to facilitate reading and explanations.

   

(09-15-2022 03:01 PM)Werner Wrote:  
(09-15-2022 02:22 PM)David Hayden Wrote:  Has anyone determined if the check for iterations>50 is necessary? In other words, are there any numbers that hit 50 iterations before overflowing 10 or 12 digits?
Adding a number to its reverse doubles the number, 'on average' ;-)
2^50 > 1e15, so I guess not.

I am of Werner's opinion, especially since I have not found any integers that would contradict his assumption. So I shortened the previous code which now becomes:


   

Finally, here is how the jury could have verified the correct operation of this expression:
    Turn on the SHARP EL-5150 by sliding the selector to the COMP position.
  • Find the expression HHC2022 among the multitude of expressions in reserve by typing the beginning of the name and pressing, possibly several times, the green TITLE key until 24:HHC2022 is matched.
  • Activate this expression by pressing the green COMP key.
  • Immediately the calculator asks for the value of the argument by displaying N=?. Cursor blinking on question mark.
  • Enter the desired value and confirm by pressing the green COMP key.
  • The answer is displayed without too much delay (although this strongly depends on the number of iterations necessary for the calculations).
  • The second result is obtained immediately by pressing a second time on COMP.
The responses carry the labels ANS 1= and ANS 2= which correspond respectively to registers 1: and 2: (RPL) or X: and Y: (RPN).

Code:
▌                        ▐  OFF --> COMP
▌COMP MODE               ▐  .
▌                  0.    ▐  H H C
▌HHC_                    ▐  TITLE
▌24:HHC2022              ▐  COMP

▌N=?                     ▐  51
▌N=51_                   ▐  COMP
▌ANS 1=           66.    ▐  COMP
▌ANS 2=            1.    ▐  COMP

▌N=?                     ▐  88
▌N=88_                   ▐  COMP
▌ANS 1=        44044.    ▐  COMP
▌ANS 2=            6.    ▐  COMP

▌N=?                     ▐  188
▌N=188_                  ▐  COMP
▌ANS 1=       233332.    ▐  COMP
▌ANS 2=            7.    ▐  COMP

▌N=?                     ▐  98
▌N=98_                   ▐  COMP
▌ANS 1=            0.    ▐  COMP
▌ANS 2=            0.    ▐  COMP

▌N=?                     ▐  99899
▌N=99899_                ▐  COMP
▌ANS 1=   2217777122.    ▐  COMP
▌ANS 2=           10.    ▐  COMP

▌N=?                     ▐  9338
▌N=9338_                 ▐  COMP
▌ANS 1=            0.    ▐  COMP
▌ANS 2=            0.    ▐
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HHC 2022 - Programming Contest - no responses until after 6am Monday 6am CENTRAL - C.Ret - 09-16-2022 12:19 PM



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