About calculator benchmark (8 queens) and fast devices. MS challenge #2
|
12-26-2018, 04:19 AM
Post: #22
|
|||
|
|||
RE: About calculator benchmark (8 queens) and fast devices. MS challenge #2
From Calculator Benchmark
0.130 FX-CG50 MicroPython / OS 3.20 Code:
This seems a remarkably fast result. Does it really outperform the prime D ? 0.158 HP-Prime Formula / List / G2 / HW.D Code: EXPORT NQUEENS() BEGIN R:=8; L1:=MAKELIST(0,X,1,R,1); S:=0; X:=0; REPEAT X:=X+1; L1(X):=R; REPEAT S:=S+1; Y:=X; WHILE Y>1 DO Y:=Y-1; T:=L1(X)-L1(Y); IF T==0 OR X-Y==ABS(T) THEN Y:=0; L1(X):=L1(X)-1; WHILE L1(X)==0 DO X:=X-1; L1(X):=L1(X)-1; END; END; END; UNTIL Y==1 END; UNTIL X==R END; S; END; |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)