Prime words: Difference between revisions
m
→{{header|Raku}}: typos, tweaks
(Added Go) |
Thundergnat (talk | contribs) m (→{{header|Raku}}: typos, tweaks) |
||
Line 255:
say 'Number of words whose ords are all prime: ',
@words.hyper.map({ next unless all(.comb.».ord).is-prime; $_ }).&{"{+$_};\n{.join: ', '}"};
say "\nNumber of words whose ordinal sum is prime: ",
@words.map({ $_ if .comb».ord.sum.is-prime }).&{"{+$_};\nFirst 20: {.head(20).join: ', '} ..."};
say "\n\
say "\nNumber of words that are prime in base 36: ",
Line 274:
say "\nNumber of words whose 'digits' are all prime using a custom base: ",
@words.hyper.map({ next if .contains(/<-alpha>/); $_ if all(.comb».&from-base(26)).is-prime }).&{"{+$_};\n{.join: ', '}"};
say "\nNumber of words that are prime using a custom base: ",
Line 289:
Number of words that are prime in base 36: 1106;
|