Isograms and heterograms: Difference between revisions

→‎{{header|Raku}}: Add a Raku example
(Add Factor)
(→‎{{header|Raku}}: Add a Raku example)
Line 136:
voluntarism
</pre>
 
=={{header|Raku}}==
<lang perl6>my $file = 'unixdict.txt';
 
my @words = $file.IO.slurp.words.map: { $_ => .comb.Bag };
 
(6...2).map: -> $n {
next unless my @iso = @words.grep({.value.values.all == $n}).map: *.key;
say "\n({+@iso}) {$n}-isograms:\n" ~ @iso.sort({[-.chars, ~$_]}).join: "\n";
}
 
my $minchars = 10;
 
say "\n({+$_}) heterograms with $minchars or more characters:\n" ~
.sort({[-.chars, ~$_]}).join: "\n" given
@words.grep({.key.chars >$minchars && .value.values.max == 1})».key;</lang>
{{out}}
<pre>(2) 3-isograms:
aaa
iii
 
(31) 2-isograms:
beriberi
bilabial
caucasus
couscous
teammate
appall
emmett
hannah
murmur
tartar
testes
anna
coco
dada
deed
dodo
gogo
isis
juju
lulu
mimi
noon
otto
papa
peep
poop
teet
tete
toot
tutu
ii
 
(32) heterograms with 10 or more characters:
ambidextrous
bluestocking
exclusionary
incomputable
lexicography
loudspeaking
malnourished
atmospheric
blameworthy
centrifugal
christendom
consumptive
countervail
countryside
countrywide
disturbance
documentary
earthmoving
exculpatory
geophysical
inscrutable
misanthrope
problematic
selfadjoint
stenography
sulfonamide
switchblade
switchboard
switzerland
thunderclap
valedictory
voluntarism</pre>
 
=={{header|Wren}}==
10,333

edits