diff --git a/src/samplesrc/sieve.pla b/src/samplesrc/sieve.pla index 1c4a2db..0fd927b 100644 --- a/src/samplesrc/sieve.pla +++ b/src/samplesrc/sieve.pla @@ -1,15 +1,3 @@ -;10 S=8190: DIM F(8191): N=0 -;20 FOR I=0 TO S: F(I)=1: NEXT I -;30 FOR I=0 TO S -; IF F(I)=0 THEN 80 -;40 P=I+I+3: K=I+P -;50 IF K>S THEN 70 -;60 F(K)=0: K=K+P -; GOTO 50 -;70 N=N+1: REM PRINT P;" "; -;80 NEXT I -;90 PRINT: PRINT N;" PRIMES": END - import STDLIB predef syscall, call, memset, getc, putc, puts, putln byte MACHID @@ -18,9 +6,9 @@ end const FALSE = 0 const TRUE = !FALSE const maxPrime = 8190 -const numPrimes = maxPrime+1 +const nums = maxPrime+1 -byte flag[numPrimes] +byte flag[nums] byte iter word prime, i, k, count byte strPrimes[] = " primes.\n" @@ -44,7 +32,7 @@ end beep for iter = 1 to 10 - memset(@flag, numPrimes, TRUE) + memset(@flag, nums, TRUE) count = 0 for i = 0 to maxPrime if flag[i]