home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
w3_prog
/
lbas09p2.arj
/
SIEVE.BAS
< prev
next >
Wrap
BASIC Source File
|
1992-03-06
|
497b
|
24 lines
'This is a Sieve benchmark translated from BYTE 1985
' May, page 286
size = 7000
dim flags(7001)
print "Start one iteration: "; time$()
count = 0
for i = 0 to size
flags(i) = 1
next i
for i = 0 to size
if flags(i) = 0 then 170
prime = i + i + 3
k = i + prime
120 if k > size then 160
flags(k) = 0
k = k + prime
goto 120
160 count = count + 1
170 next i
print time$(); " done: "; count; " primes found."