home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
zip
/
portfoli
/
pbas45.lzh
/
sieve.bas
< prev
next >
Wrap
BASIC Source File
|
1991-08-21
|
316b
|
15 lines
10 START = TIMER
20 MP=2000:DIM P(MP)
30 CLS:PRINT "Eratosthenes Sieve - " MP:M=MP
40 M1=SQR(M)
50 REM PRINT "2";
60 FOR I=3 TO M STEP 2
70 IF P(I)=1 THEN 130
80 REM PRINT " ";I;
90 IF I>M1 THEN 130
100 FOR J=I*I TO M STEP I+I
110 P(J)=1
120 NEXT
130 NEXT
140 PRINT "Time: " TIMER - START
ə