HP Forums

Full Version: Apps for the prime.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all, I cannot live without my recently deceased 42S so I am looking for something else. I have used RPN for the last 25 years and want to stick with that for my day to day use.

It's been so long since I needed to buy a new calculator that I don't see any reason for not going for a top of the line one as the prices are so different than they used to be, price isn't even a consideration when you can get something like this for $115.

There were a couple reasons I need a real calc over an iPad/phone calc, in one of the environments I work in I need to wear gloves when doing calcs, the iPad/phone solution doesn't really work there. I also like buttons!

Now the question I asked in the subject was around apps? I am just about to go through the documentation and my get the answers there but thought it good to ask before I buy.

Is there any chance that programs can be written to quiz math facts, e.g. multiplication tables?

The reason is for my son. I can write the app if it is possible. I remember when I was young and had calculators that did all sorts of things I had no idea about I was fascinated playing with them. It's part of what has given me a lifelong interest in the sciences.

I know I could get an iPad app to do the same thing but I was thinking he might get the same enjoyment I used to get when I was younger playing around with a calculator.

Thanks,
Jason
Hello,

Yes, you could easely write such an app on Prime...

Now, if you do, PLEASE PLEASE PLEASE post it so that I can use it for my own son!!!

Bonnus point if you can limit the app to certain tables (for example, at this point in time, my son only needs to know his tables up to 5...)

Cyrille
Thanks for the reply Cryille.

Yes, I have been having a bit of a look and running the emulator to play around. Looks like I can do it.

I had the same thought as you, he wouldn't be learning the larger tables just yet. When he does longer multiplication at the moment he just uses a sheet I have printed out so he can get by with 7*9 etc.

Thanks,
Jason
(06-25-2014 02:00 AM)Metalnwood Wrote: [ -> ]Hi all, I cannot live without my recently deceased 42S so I am looking for something else. I have used RPN for the last 25 years and want to stick with that for my day to day use.

Sorry to hear of your loss Sad

Depending on what you need/want perhaps you would be better off with a 50g. You can still buy a 42S, but they won't be cheap.
I don't know the 50g but I agree with HP67. The Prime is a disappointing RPN calculator and I read that matters to you.
I didn't mean to get into a Prime vs. 50g thread since there are already enough of those.

All I meant was if RPN is a priority, perhaps the 50g would be more suitable. Please be aware neither the Prime nor the 50g use keystroke programming. The 50g uses HP's RPL programming language which is based on and an evolution of RPN. The Prime uses a special Pascal-like programming language.

None of the 42S code will port straight across, and there will be a significant learning curve with either machine. Still, at the end of the day, the 50g is much more similar to the 42S than the Prime is. All the RPN concepts and much of the way you use it will map to the 50g fairly well. You will be able to use it instantly for calculations; only the programming and new functions will require some quality time with the doc.
I agree: 50g
(06-25-2014 05:47 AM)Metalnwood Wrote: [ -> ]Thanks for the reply Cryille.

Yes, I have been having a bit of a look and running the emulator to play around. Looks like I can do it.

I had the same thought as you, he wouldn't be learning the larger tables just yet. When he does longer multiplication at the moment he just uses a sheet I have printed out so he can get by with 7*9 etc.

Thanks,
Jason

If you want, consider using a saved spreadsheet app (vs program). Here is a shot of a crude sheet that generates/saves two integers, allows for a guess then feedback if correct or not. Its not pretty but its a start.

[attachment=893]

and here are the contents of the cells

[attachment=894]

I would download the Prime emulator and try it out for this, RPN and other features you care about.

Prime, 50G or other - if your child keeps messing around with it then that's a good sign!

ps - If you want to get fancy, put some algebra or CAS calculus questions in the Prime spreadsheet (or program). It can generate answers to those in real time too.
Thanks all for the replies!

The 50g certainly fills the nostalgia a little bit more than the prime but I think the prime might work a bitter better for my son.

I haven't programmed my 42S for a long time, when I talk about using RPN it's more how I like to work with it in the workshop doing a few calculations so I would be surprised if it doesn't work how I am used to.

I did start to make the application last night. It was pretty simple, its language is close to a lot of languages I have had to use over the years, my only hiccup was using '=' as assignment instead of ':=' then wondering for a little while why things remained at their initial value Smile

The only thing I didn't like was the INPUT function. It uses a fullscreen dialog and I was hoping to have some function that would read/write kb presses on the screen.

No problem, I can write one with textoutput and getkey but it seems like something should exist for people using textoutput and graphics for their display who don't want the entire screen hidden during input.

I have not looked at the 50G so I will do that anyway, I have a feeling that the 50g might last as long as my 42s but I doubt the prime would.
Hello

Quote:No problem, I can write one with textoutput and getkey but it seems like something should exist for people using textoutput and graphics for their display who don't want the entire screen hidden during input.

My advise for such an app:

do a text out with a large font on an offscreen graph. Then stretch blit this graph on the screeen (to make it even bigger as the font size on text out is limited)... this will allow you to write a large A*B on the top of the screen. maybe with a colored background...

then do WAIT(0) to wait for key presses and display them at the bottom of the screen...

cyrille
Hi Cyrille, I did find that you can make the WAIT function wait for a keyboard, thats good as on first glance it looked like you couldn't WAIT for less than a second and the only other option was a loop running full tack.

This is what I have come up with, I am sure there are more elegant ways to do it with HP's language but I am only an hour and a half in to using this calculator Smile

While working on the input that I have ReadInt I found that the key codes could be a little better, they don't have the ascii codes, I can live with that but it is a shame that the numeric keys are not grouped together, they are in groups of three with gaps in between so the read function is quite long already, without error checking.

Maybe there is a better way but i have not seen it in the manual.

Very basic so far, no real feedback other than a score at the bottom. I might keep a running high score but certainly add the feedback, i.e. correct, wrong - the right answer is .. etc.

I ordered a prime today, I am in New Zealand so I will have to wait for it to arrive from the states, it will probably take 1 1/2 weeks but getting it for $140NZD vs ~$300NZD locally made it a no brainer.

Code:
   
WriteScore(s);
ReadInt(xPos, yPos);

EXPORT multiplication()
BEGIN
  Local Score:=0, x:=0, y:=0, M:=0, Ans:=0;
  CHOOSE(M, "How big do you want to go?", "1", "2", "3", "4", "5", "6", "7", "8");
  Rect();
  TEXTOUT_P("Lets learn our tables up to " + M, 0, 2);

  FOR C FROM 1 TO 5 DO
    x:= floor(random(2, M));
    y:= floor(random(2, M));


    Rect_P(0, 100, 320, 150 );
    TEXTOUT_P("What is " + x +" x " + y,100,100 );
     

    Ans := ReadInt( 140,140);

    if Ans == x*y then
         Score := Score+1;
    end;

    WriteScore(Score);
  

  END;

   return Ans;

END;


WriteScore(s)
BEGIN
  RECT_P(0,200,320, 240);
  TEXTOUT_P("Score : "+ s, 0, 200);
END;

ReadInt(xPos, yPos)
BEGIN
   Local loop:=1, key, Ans :="";

   While loop do

      TEXTOUT_P(Ans, xPos, yPos);
      key := Wait(-1);
      if key == 30 then
        loop := 0;
        break;
      end;
     
      if key < 35 then
        Ans := Ans + (key-25);
        continue;
      end;

      if key < 40 then
        Ans := Ans + (key-33);
        continue;
      end;

      if key < 45 then
        Ans := Ans + (key-41);
        continue;
      end;

      if key == 47 then
        Ans := Ans + "0";
        continue;
      end;     

   END;
   RECT_P(xPos, yPos, xPos+ 50, yPos+50);
   return expr(Ans);
END;
Hello


>it looked like you couldn't WAIT for less than a second

WAIT(0.5) for 1/2 a second?



>I am only an hour and a half in to using this calculator Smile
Not bad for a newbie!

> key codes could be a little better
Ascii codes would not work as we have too many 'function' keys... it's just a habit I think to have the keys 'numbered'...

>I am in New Zealand so I will have to wait for it to arrive from the states, $140NZD vs ~$300NZD locally made it a no brainer.
When I bought my first HP Calcualtor (HP48SX), they were $200 in the US versus 3000 french franc. This came out as a 2.5 times difference also! One of my uncle bought mine in the states and grought it back!


>x:= floor(random(2, M));
There is a RANDINT function for this...

ReadInt
have you thought about using POS? as in: local id= pos({ 47 42 43 44 37 38 39 32 33 34 30 }, wait(-1))-1;

local ans= "";
while 1 do
textout_p(ans, xPos, yPos);
if id==10 then
rect_p(xPos, yPos, xPos+ 50, yPos+50); return expr(ans);
end;
ans:= ans+id;
end;
There you go, POS!

Yes, that would do it fine Smile Yes, you are right that ascii won't work for the calc given it's mathematical keyboard, it was more the continuous block that the numeric keys have in ascii that was appealing here. The pos function sorts that out fine though.


Thanks,
Jason
Reference URL's