Quote:... If we now use a different test code that is a bit faster but the execution path has been significantly changed, we would have to question all the other test codes and look for better implementations to be fair. ...
I made three programs identical in structure for CASIO and TI and brought the calculation path to a single standard: 876 steps, 2205 comparisons
If T=0 or X-Y=Abs(T), as is in this benchmark.
CASIO:
Code:
ClrText : 8->R : {R,1}->Dim Mat A
0->S : 0->X : 0->Z
While Z<0 Or X<>R
If Z>=0 : Then Isz X : R->L
Else Dsz X : Mat A[X,1]-1->L
If X=0 : Then Break
IfEnd
IfEnd
For L->Y To 1 Step -1
For X-1->Z To 1 Step -1
Y-Mat A[Z,1]->T
If T=0 Or X-Z=Abs T
Then -1->Z : Break
IfEnd
Next : Isz S
If Z>=0 : Then Y->Mat A[X,1]
Break
IfEnd
Next
WhileEnd : S
TI Z80:
Code:
ClrHome : 8->R : R->dim(L1)
0->S : 0->X : 0->Z
While Z<0 or X<>R
If Z>=0 : Then : X+1->X : R->L
Else : X-1->X
If X=0 : Then : 1->Z : R->X : 0->L
End
L1(X)-1->L
End
For(Y,L,1,-1)
For(Z,X-1,1,-1)
Y-L1(Z)->T
If T=0 or X-Z=abs(T) : -1->Z
End : S+1->S
If Z>=0 : Then : Y->L1(X) : 0->Y
End
End
End : Disp S
TI 68K:
Code:
nqueens()
prgm
ClrIO
Local a, l, r, s, t, x, y, z
8->r : 0->s : 0->x : 0->z
newList(r)->a
While z<0 or x<>r
If z>=0 Then
x+1->x : r->l
Else
x-1->x
If x=0 : Exit
a[x]-1->l
EndIf
For y, l, 1, -1
For z, x-1, 1, -1
y-a[z]->t
If t=0 or x-z=abs(t) Then
-1->z : Exit
EndIf
EndFor
s+1->s
If z>=0 Then
y->a[x] : Exit
EndIf
EndFor
EndWhile
Disp s,a
EndPrgm
Here is a table with the results for several well-known old models. Perhaps this information will be of interest to someone.
Code:
22.5_s fx-9750gii(SH3)
42_s fx-9860gii(SH4)
46_s ti-83+SE
58_s ti-84+/84+SE (new HW, OS 2.55MP, classic mode)
67_s = 1:07 ti-84+ (old HW)
78_s = 1:18 ti-89 Titanium (HW3, exact mode)
103_s = 1:43 fx-2.0+, graph-100+
114_s = 1:54 ti-85 (OS ver.9.0)
119_s = 1:59 ti-83+