Good news :-)



#14

Finally the HP-39gII emulator has officially arrived:

http://www.hp.com/sbso/product/calculators-emulators/graphic-calculator-emulators.html

Rev.18360 from 4th Sept.

Franz


#15

Thanks, Franz (and HP!). I love the "large" (landscape) skin! I want a real 39gii calculator looking like that one! HP would sell millions of them!!!

Is there any updated firmware yet for my real (portrait) 39gii?

Nigel (UK)

#16

I forget how to display the rev number on mine ! It was not ON & F4 ?

Does this version correct the CASE bug ?

I agree that the landscape skin is great :)

For those interested, here is my first complex program on this device. "Le compte est bon 'in french... Countdown ...

http://en.wikipedia.org/wiki/Countdown_%28game_show%29

//================================
// Le compte est bon - HP39gII
//--------------------------------

// Variables globales
LOp:={" plus "," moins "," fois ", " divisé par "};
Sol; Cible; Ecart;MeilleurCoup,Tirage;

// Génére une liste contenant la meilleure solution
AffSol (n1,Op,n2,n3)
BEGIN
Sol:=CONCAT(Sol, ""+MAX(n1,n2)+LOp(Op)+MIN(n1,n2)+"->"+n3);
END;

// Le coeur du programme
LCB(Tab,Nb)
BEGIN
LOCAL i,j,Op,T1,r:=0;
FOR i FROM 1 TO Nb-1 DO
FOR j FROM i+1 TO Nb DO
FOR Op FROM 1 TO 4 DO
Tab=>T1;
IF Op==1 THEN // To avoid CASE problem
T1(i)+T1(j)=>T1(i);
ELSE
IF Op==2 THEN
ABS(T1(i)-T1(j))=>T1(i);
ELSE
IF Op==3 THEN
T1(i)*T1(j)=>T1(i);
ELSE
IF (T1(j)<>0) AND (T1(i) MOD T1(j)==0) THEN
T1(i)/T1(j)=>T1(i);
ELSE
IF (T1(i)<>0) AND (T1(j) MOD T1(i)==0) THEN
T1(j)/T1(i)=>T1(i);
ELSE
BREAK;
END;
END;
END;
END;
END;
IF T1(i)==Cible THEN AffSol(Tab(i),Op,Tab(j),T1(i)); r:=1; BREAK(3); END; // RETURN(1) don't work
IF ABS(T1(i)-Cible)<Ecart THEN
MeilleurCoup:=T1(i);
Ecart:=ABS(Cible-MeilleurCoup);
END;
T1(Nb)=>T1(j);
IF LCB(T1,Nb-1) THEN AffSol(Tab(i),Op,Tab(j),T1(i)); r:=1; BREAK(3); END;
END;
END;
END;
RETURN r;
END;

// Le programme principal

EXPORT Compte(t,c)
BEGIN
LOCAL n;
Cible:=c;
Ecart:=999;
MeilleurCoup:=0;
Tirage:=t;
Sol:={};
PRINT ("***** LE COMPTE EST BON *****");
PRINT (Tirage);
PRINT ("Nombre à trouver : " + Cible);
PRINT ("");
IF NOT(LCB(Tirage,6)) THEN
PRINT("Solution la plus proche :" + MeilleurCoup);
Cible:=MeilleurCoup;
Ecart:=999;
LCB(Tirage,6)
END;
REVERSE(Sol)=>Sol;

FOR n FROM 1 TO SIZE(Sol) DO
PRINT(" " + Sol(n));
END;
RETURN Sol;
END;

For exemple :

Compte({6,6,25,4,100,9}, 923}


Edited: 22 Sept 2012, 7:26 a.m.


#17

Gilles .. you are super cool ... I have been working on the same French game .. trying to write an implementation for Excel VBA.

Thank you sooooooooooooooooooo much for your listing!

Namir


#18

Note that the code would be more lisible with CASE :

CASE
IF Op==1 THEN T1(i)+T1(j)=>T1(i); END;
IF Op==2 THEN ABS(T1(i)-T1(j))=>T1(i); END;
IF Op==3 THEN T1(i)*T1(j)=>T1(i); END;
IF Op==4 THEN
CASE
IF (T1(j)<>0) AND (T1(i) MOD T1(j)==0) THEN T1(i)/T1(j)=>T1(i); END;
IF (T1(i)<>0) AND (T1(j) MOD T1(i)==0) THEN T1(j)/T1(i)=>T1(i); END;
DEFAULT BREAK;
END;
END;
...

But there is a bug with the CASE in my HP39 version. HP knows and is working to solve this in futur update

Note also that in the contrary of what is wrote in user guide on the CD, there is no difference between

T1(j)/T1(i)=>T1(i) // dont' know why, but i hate this syntax lol...

and

T1(i):=T1(j)/T1(i)

as you can aloso see, the user guide is not accurate about use of LOCAL variables. You can assing value in the same line than the LOCAL definiton

The BREAK (level) is interesting (but not documented as far i know; Cyrille explain this here)

When I wrote this first verion there was also some problem with the RETURN function in some cases. I think it's solved in the new ROM but not sure.

The HP39gII langage is very interesting, simple and powerfull.

An interesting improvement could be to allow like in PASCAL to call a function (or a procedure in Pascal) with paramaters 'per variable' and not only 'per value' (sorry for my english). This would allow for exemple to swap 2 variables like this :

EXPORT SWAP( VAR : a , VAR : b)
BEGIN
LOCAL c
c:=a; a:=b; b:=c;
END;

and then use
SWAP(x,y) to swap the content of x <-> y .
It's very interesting in many cases

#19

Ahhh! I love the show "Des chiffres et des lettres" ever since I spend two weeks in a pupil's exchange in France back in 1980. I wonder why this show is running for so long but never was adapted in Germany or elsewhere as far as I know?!?

Edited: 22 Sept 2012, 10:18 a.m.

#20

Gilles,

Does the first two nested loops in LCB() cover all the possible arrangements for the six numbers given? I suspect they don't. My Excel VBA version uses SIX loops to do that ... and also uses IF statements to make sure that the indices are not duplicated. I checked with a DEBUG.PRINT statement to verify that I am trying ALL the combinations of the six numbers.

Namir


#21

Gilles,

I was able to adapt your HP39gII code to Excel VBA. I see now that you perform recursive calls to LCB(). Your solution works very well and does it quickly!

<bows down>

Namir


#22

Happy this have help you Namir!

I will try to do an APPS for this with the 39gII when i have time and the CASE problem is solved.

#23

Thank for the news.

Who is this man who looks at you during download? I find it disturbing!


#24

Quote:

Who is this man who looks at you during download?


It's not me - I'm much nicer! :-)

#25

Tim perhaps ;)
"You had to wait a long time, but it' here ! Enjoy "


Edited: 22 Sept 2012, 9:14 a.m.

#26

I assume this is the man who cannot afford a calculator (TM) - therefor the chalkboard in the background <g>


Possibly Related Threads…
Thread Author Replies Views Last Post
  Trivial news of the 43S (no Prime) Walter B 117 30,737 11-22-2013, 03:26 AM
Last Post: Raymond Del Tondo
  Good puzzle for kids to solve on 35s? snaggs 11 3,484 09-18-2013, 10:40 PM
Last Post: David Hayden
  News from the 43S Walter B 78 13,944 07-08-2013, 10:33 AM
Last Post: Victor Koechli
  Great news - Vicinno's HP 15C Scientific Calculator iPhone app is FREE now John 21 6,318 06-07-2013, 05:49 AM
Last Post: Mike (Stgt)
  A good general mathematics reference book? Chris Smith 11 3,464 04-29-2013, 09:44 AM
Last Post: Chris Smith
  HP 35 Pretty Good Purchase Today! Norman Dziedzic 1 1,487 03-05-2013, 12:52 AM
Last Post: Dan Lewis
  Good (simple?) calculation for benchmarking? Jedidiah Smith 28 7,423 03-01-2013, 05:13 PM
Last Post: Harald
  Good news for HP-emulator fans! :-) fhub 44 11,483 02-19-2013, 04:11 PM
Last Post: Marcus von Cube, Germany
  Some news for old HP emulator fans! ;-) Olivier De Smet 3 1,679 02-10-2013, 08:47 PM
Last Post: Earl Kubaskie
  Sad news Eric Smith 7 2,653 02-08-2013, 09:27 AM
Last Post: Eddie W. Shore

Forum Jump: