Odd words: Difference between revisions
Content added Content deleted
(add freebasic) |
|||
Line 85: | Line 85: | ||
wrangle ---> wage |
wrangle ---> wage |
||
wrigley ---> wily</pre> |
wrigley ---> wily</pre> |
||
=={{header|Phix}}== |
|||
<lang Phix>sequence words = split_any(get_text("demo/unixdict.txt")," \r\n") |
|||
function odd(integer /*ch*/, idx) return remainder(idx,2)=1 end function |
|||
function oddch(string word) return filter(word,odd) end function |
|||
function over4(string word) return length(word)>4 end function |
|||
words = filter(filter(apply(words,oddch),over4),"in",words) |
|||
printf(1,"%d odd words found: %s\n",{length(words),join(shorten(words,"",3),", ")})</lang> |
|||
{{out}} |
|||
<pre> |
|||
14 odd words found: brain, cider, cried, ..., spree, spree, trial |
|||
</pre> |
|||
=={{header|Ring}}== |
=={{header|Ring}}== |