Emirp primes: Difference between revisions
→{{header|ALGOL 68}}: Use ALGOL 68-primes
m (→The function) |
(→{{header|ALGOL 68}}: Use ALGOL 68-primes) |
||
Line 109:
Uses Algol 68G specific argc and argv procedures to access to command line.
Allows the user to specify the from and to range values or ordinals on the command line. The sieve size can also be specified. As suggested by the Fortran sample, from = to is treated as a special case for labeling the output.
{{libheader|ALGOL 68-primes}}
<lang algol68># parse the command line - ignore errors #▼
▲# parse the command line - ignore errors #
INT emirp from := 1; # lowest emirp required #
INT emirp to := 10; # highest emirp required #
Line 153 ⟶ 142:
# construct a sieve of primes up to the maximum number required for the task #
PR read "primes.incl.a68" PR
# return TRUE if p is an emirp, FALSE otherwise #
|