Iccanobif primes: Difference between revisions
m
→{{header|Raku}}: doh. display number in correct orientation
Thundergnat (talk | contribs) m (→{{header|Raku}}: a few more) |
Thundergnat (talk | contribs) m (→{{header|Raku}}: doh. display number in correct orientation) |
||
Line 20:
<syntaxhighlight lang="raku" line>sub abbr ($_) { (.chars < 41 ?? $_ !! .substr(0,20) ~ '..' ~ .substr(*-20)) ~ " (digits: {.chars})" }
say (++$).fmt('%2d') ~ ': ' ~ .flip.&abbr for (lazy (1,1,*+*…*).hyper.grep: {.flip.is-prime})[^25];</syntaxhighlight>
{{out}}
<pre> 1: 2 (digits: 1)
2: 3 (digits: 1)
3: 5 (digits: 1)
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
</pre>
|