Prime words: Difference between revisions

m
→‎{{header|Raku}}: typos, tweaks
(Added Go)
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\nIterpretingnInterpreting the words as if they were base 36 numbers:";
 
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:
 
 
IterpretingInterpreting the words as if they were base 36 numbers:
 
Number of words that are prime in base 36: 1106;
10,327

edits