Jump to content

Nice primes: Difference between revisions

m
→‎{{header|REXX}}: changed a comment.
(→‎{{header|Raku}}: Alternate)
m (→‎{{header|REXX}}: changed a comment.)
Line 513:
if $\=='' then say center(idx, 7)"│" substr($, 2) /*possible display residual output.*/
say
say 'Found ' commas(Nprimes) @nice " and@nice " commas(hi) ' (not inclusive).'
exit 0 /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
commas: parse arg ?; do jc=length(?)-3 to 1 by -3; ?=insert(',', ?, jc); end; return ?
/*──────────────────────────────────────────────────────────────────────────────────────*/
genP: !.= 0 /*placeholders for primes; width of #'s(semaphores).*/
@.1=2; @.2=3; @.3=5; @.4=7; @.5=11 /*define some low primes. */
!.2=1; !.3=1; !.5=1; !.7=1; !.11=1 /* " " " " flags. */
Cookies help us deliver our services. By using our services, you agree to our use of cookies.