Palindrome pairs: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) (→{{header|Perl 6}}: Add a Perl 6 example) |
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: Slightly better palindrome detection. Ignore, case, punctuation and white-space. Same output) |
||
Line 18: | Line 18: | ||
<lang perl6>my @words = <abcd dcba lls s sssll>; |
<lang perl6>my @words = <abcd dcba lls s sssll>; |
||
sub is-palindrome (Str $s) { $ |
sub is-palindrome (Str $s) { $_ eq .flip given $s.lc.comb(/\w/).join } |
||
for @words.combinations(2) { |
for @words.combinations(2) { |