Last active
September 30, 2015 07:56
-
-
Save BigEd/e9e28718eb3205a42221 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 MA=100:MP=20:T1=TIME:DIM NP(MA) | |
110 FOR I=2 TO 100:NP(I)=0:NEXT | |
120 D=2 | |
130 IF D*D>MA GOTO 170 | |
140 IF NP(D)=1 GOTO 160 | |
150 FOR I=2*D TO MA STEP D:NP(I)=1:NEXT | |
160 D=D+1:GOTO 130 | |
170 PRINT "CALCULATION TOOK";TIME-T1;" JIFFY TICKS":PRINT | |
180 PRINT"PRIMES:";:I=2:C=0 | |
190 IF NP(I) THEN I=I+1:GOTO 190 | |
200 PRINT I;:I=I+1 | |
210 C=C+1:IF C<MP THEN PRINT",";:GOTO 190 | |
220 PRINT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment