Good news :-) fhub Posting Freak Posts: 1,216 Threads: 75 Joined: Jun 2011 09-22-2012, 05:56 AM Finally the HP-39gII emulator has officially arrived: Rev.18360 from 4th Sept. Franz Nigel J Dowrick Member Posts: 167 Threads: 13 Joined: Sep 2008 09-22-2012, 07:08 AM 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) Gilles Carpentier Senior Member Posts: 468 Threads: 17 Joined: May 2011 09-22-2012, 07:25 AM 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)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. C.Ret Senior Member Posts: 260 Threads: 0 Joined: Oct 2008 09-22-2012, 07:55 AM Thank for the news. Who is this man who looks at you during download? I find it disturbing! Namir Posting Freak Posts: 2,247 Threads: 200 Joined: Jun 2005 09-22-2012, 08:03 AM 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 fhub Posting Freak Posts: 1,216 Threads: 75 Joined: Jun 2011 09-22-2012, 09:05 AM Quote: Who is this man who looks at you during download? It's not me - I'm much nicer! :-) Gilles Carpentier Senior Member Posts: 468 Threads: 17 Joined: May 2011 09-22-2012, 09:10 AM 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 Gilles Carpentier Senior Member Posts: 468 Threads: 17 Joined: May 2011 09-22-2012, 09:12 AM Tim perhaps ;) "You had to wait a long time, but it' here ! Enjoy " Edited: 22 Sept 2012, 9:14 a.m. Alexander Oestert Senior Member Posts: 429 Threads: 31 Joined: Jul 2011 09-22-2012, 10:17 AM 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. Frank Boehm (Germany) Senior Member Posts: 415 Threads: 19 Joined: Jan 2005 09-24-2012, 08:10 AM I assume this is the man who cannot afford a calculator (TM) - therefor the chalkboard in the background Namir Posting Freak Posts: 2,247 Threads: 200 Joined: Jun 2005 09-25-2012, 10:52 PM 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 Namir Posting Freak Posts: 2,247 Threads: 200 Joined: Jun 2005 09-26-2012, 02:01 AM 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! Namir Gilles Carpentier Senior Member Posts: 468 Threads: 17 Joined: May 2011 09-26-2012, 02:10 PM 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. « Next Oldest | Next Newest »

 Possibly Related Threads... Thread Author Replies Views Last Post Trivial news of the 43S (no Prime) Walter B 117 18,503 11-22-2013, 03:26 AM Last Post: Raymond Del Tondo Good puzzle for kids to solve on 35s? snaggs 11 2,475 09-18-2013, 10:40 PM Last Post: David Hayden News from the 43S Walter B 78 9,118 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 4,500 06-07-2013, 05:49 AM Last Post: Mike (Stgt) A good general mathematics reference book? Chris Smith 11 2,541 04-29-2013, 09:44 AM Last Post: Chris Smith HP 35 Pretty Good Purchase Today! Norman Dziedzic 1 1,059 03-05-2013, 12:52 AM Last Post: Dan Lewis Good (simple?) calculation for benchmarking? Jedidiah Smith 28 5,320 03-01-2013, 05:13 PM Last Post: Harald Good news for HP-emulator fans! :-) fhub 44 7,534 02-19-2013, 04:11 PM Last Post: Marcus von Cube, Germany Some news for old HP emulator fans! ;-) Olivier De Smet 3 1,164 02-10-2013, 08:47 PM Last Post: Earl Kubaskie Sad news Eric Smith 7 1,938 02-08-2013, 09:27 AM Last Post: Eddie W. Shore

Forum Jump: