Debugged

Just for fun, I wrote Pythagoras Numbers finding program with fx-5800P.

Pythagras numbers (a, b, c) are from a^{2} + b^{2} = C^{2} and a, b and c are given by followings;

a = (m^{2} - n^{2})/2, b = nm, c = (m^{2} + n^{2})/2

where m and n are odd and prime numbers each other, m > n and the greatest common divisor of (a, b, c) is 1.

When start this program, it displays first Pythagoras numbers (4, 3, 5).

Hit key, next Pythagoras numbers are displayed. Let me call this is 'step mode'.

Long press key will let you get in 'continuous mode' then Pythagoras numbers are continuously displayed, see video of the continuous mode.

In the continuous mode, press key you can go back to 'step mode'.

One of my friends ported this program to fx-9860GII and fx-cg10 (just modified keycodes with Getkey command) and compared its speed. fx-9860GII displays faster with just a factor of 2, surprisingly fx-cg10 displays almost same speed as fx-5800P.

I realized we should take account of display speed for rating of calcs.

Source code of "PYTHAGORAS" for fx-5800P (debugged);

3->M:1->1:1->D:1->E Locate 1,2,"A=" Locate 1,3,"B=" Locate 1,4,"C=" Lbl 0 E=0=>Locate 7,1,"(-):Stop" (M^2-N^2)÷2->A MN->B (M^2+N^2)÷2->C Locate 1,1,D Locate 3,2," " Locate 3,2,A Locate 3,3," " Locate 3,3,B Locate 3,4," " Locate 3,4,C Getkey=57=>1->E 0->K While Getkey=47 Isz K:K=7=>Break WhileEnd:K=7=>0->E E=1=>Locate 7,1,"EXE:Next"◢ Do N-2->N If N<0:Then M+2->M:M-2->N IfEnd N=1->Break LpWhile Frac(M+N)=0 Isz D Goto 0

**Edited by Krtyski, 07 December 2014 - 02:27 AM.**