quick mini-challenge for 12c



#10

All right, write the shortest possible program for the 12c that does this: You input the sum of 2 numbers, the difference of the same 2 numbers, and the program calculates and displays the 2 numbers.


#11

01- STO 0
02- +
03- 2
04- /
05- ENTER
06- ENTER
07- RCL 0
08- -

Too many steps?


#12

Gerson, your program displays the smaller of the two numbers, but not the larger (if I entered it correctly).


#13

Sorry, I forgot to mention the other number is in register Y.


#14

Yes, I saw that after I replied. I've got a 7 line program that pauses after the first number then displays the second.


#15

Something like this?

01 -
02 LSTx
03 x<>y
04 2
05 /
06 PSE
07 +

#16

Actually, more like your first one, except a little different:

01 STO 1
02 -
03 2
04 /
05 PSE
06 RCL 1
07 +

But yours works too. It's always great to see another mind at work!


#17

I'm glad I didn't submit my first try at your mini-challenge. A very long 9-step program :-)

Regards,

Gerson.


#18

Gerson, don't feel bad! My first try was 14 steps, but I knew it could be improved. My goal was to get to 8 or fewer steps, since the first 8 steps are "free" (that is, you don't lose any registers). Being a minimalist, I am intrigued by fitting a program in 8 steps on the 12c, if possible.

Thanks for your example.


Possibly Related Threads...
Thread Author Replies Views Last Post
  Prime: Quick and Dirty AXL Helge Gabert 0 623 10-03-2013, 06:36 PM
Last Post: Helge Gabert
  HPCC Mini Conference 2013 hugh steers 6 1,622 09-13-2013, 04:27 PM
Last Post: BruceH
  HP PRIME CAS QUICK GUIDE [SPN] CompSystems 0 684 08-26-2013, 01:15 PM
Last Post: CompSystems
  Picture from the Mini-HHC (LA) Geir Isene 11 2,349 07-07-2013, 01:06 PM
Last Post: Jim Horn
  My birthday, so a little commemorative mini-challenge ! Valentin Albillo 43 5,934 03-07-2013, 03:44 AM
Last Post: Walter B
  WP 34S mini-challenge (B) Gerson W. Barbosa 17 3,346 12-27-2012, 04:39 PM
Last Post: Marcus von Cube, Germany
  is there a printing error in the HP 50G Quick Starrt Guide? Al 12 2,397 11-23-2012, 07:07 PM
Last Post: Al
  Mini-challenge: HHC2012 RPL programming contest with larger input David Hayden 14 2,666 10-05-2012, 10:36 PM
Last Post: David Hayden
  HP41 / SY41CL Mini-B USB Power Connector (Module) Matt Kernal 5 2,648 07-08-2012, 06:23 PM
Last Post: Diego Diaz
  Qama calculator, quick review Don Shepherd 16 2,896 05-08-2012, 08:45 AM
Last Post: uhmgawa

Forum Jump: