Post Reply 
Really really fast BASIC handheld
01-13-2019, 11:20 PM
Post: #31
RE: Really really fast BASIC handheld
(01-12-2019 10:00 PM)berndpr Wrote:  Here is script for 8 Queens unstructured (only 363 Bytes):
CLS
PRINT "8-Queen-Problem"
OPTION DEFINT
M=MAINCNT
K=1000
PRINT K;" times"
N=K
@L0
R=8
S=0
X=0
DIM A[9]
@L1
IF X==R GOTO @L5
INC X
A[X]=R
@L2
INC S
Y=X
@L3
DEC Y
IF Y==0 GOTO @L1
T=A[X]-A[Y]
IF T==0 GOTO @L4
IF X-Y!=ABS(T) GOTO @L3
@L4
DEC A[x]
IF A[X]!=0 GOTO @L3

@L4
DEC A[X]
IF A[X]!=0 GOTO @L2
DEC X
IF X!=0 GOTO @L4
@L5
DEC N
IF N>1 GOTO @L0
PRINT S
PRINT FORMAT$("%5.4F sec",(MAINCNT-M)/60)

I've noticed a bug in your test code. The 3 lines after the first @L4 label are surely an oversight
and don't allow to have the node count of S=876. I assume that the code of your 2DS is correct.

Calculator Benchmark
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Really really fast BASIC handheld - xerxes - 01-13-2019 11:20 PM



User(s) browsing this thread: 1 Guest(s)