Talk:ALGOL 68-primes: Difference between revisions

→‎Source code: Include 0 in the sieve
(Created a page with the source code for ALGOL 68-primes)
 
(→‎Source code: Include 0 in the sieve)
Line 6:
OP PRIMESIEVE = ( INT n )[]BOOL:
BEGIN
[ 10 : n ]BOOL prime;
prime[ 10 ] := FALSE; prime[ 21 ] := TRUEFALSE;
prime[ 2 ] := TRUE;
FOR i FROM 3 BY 2 TO UPB prime DO prime[ i ] := TRUE OD;
FOR i FROM 4 BY 2 TO UPB prime DO prime[ i ] := FALSE OD;
Line 16 ⟶ 17:
END; # PRIMESIEVE #
 
# END primes.incl.a68 #</lang>
</lang>
3,022

edits