RosettaCodeData/Task/Semordnilap/Perl-6/semordnilap.pl6
2015-11-18 06:14:39 +00:00

8 lines
222 B
Raku

my $words = set slurp("unixdict.txt").lines;
my @sems = gather for $words.flat -> $word {
my $drow = $word.key.flip;
take $drow if $drow $words and $drow lt $word;
}
say $_ ~ ' ' ~ $_.flip for @sems.pick(5);