Odd words: Difference between revisions

Content added Content deleted
(whatever)
(→‎{{header|Phix}}: added alternative)
Line 89: Line 89:
14 odd words found: brain, cider, cried, ..., spree, spree, trial
14 odd words found: brain, cider, cried, ..., spree, spree, trial
</pre>
</pre>
=== Alternative ===
Slightly more traditional, same output.
<lang Phix>sequence words = split_any(get_text("demo/unixdict.txt")," \r\n"),
res = {}
for i=1 to length(words) do
string word = words[i], wodd = ""
for oddchar=1 to length(word) by 2 do
wodd &= word[oddchar]
end for
if length(wodd)>4
and find(wodd,words) then
res = append(res,wodd)
end if
end for
printf(1,"%d odd words found: %s\n",{length(res),join(shorten(res,"",3),", ")})</lang>


=={{header|Ring}}==
=={{header|Ring}}==