Anadromes: Difference between revisions

Content added Content deleted
Line 486: Line 486:


=={{header|Julia}}==
=={{header|Julia}}==
<syntaxhighlight lang="ruby">function anadromes(minsize, csense = true, fname = "words.txt")
<syntaxhighlight lang="julia">function anadromes(minsize, csense = true, fname = "words.txt")
words = Set(filter(w -> length(w) >= minsize, split((csense ? identity : lowercase)(read(fname, String)), r"\s+")))
words = Set(filter(w -> length(w) >= minsize, split((csense ? identity : lowercase)(read(fname, String)), r"\s+")))
found = [(w, reverse(w)) for w in words if (r = reverse(w)) in words && w < r]
found = [(w, reverse(w)) for w in words if (r = reverse(w)) in words && w < r]