Jump to content

Find words with alternating vowels and consonants: Difference between revisions

m
Line 342:
 
=={{header|Julia}}==
See [[Alternade_words#Julia]] for the foreachword function.
<lang julia>isvowel(c) = c in ['a', 'e', 'i', 'o', 'u'] # NB. leaves out 'α' and similar unicode vowels, and what about y?
onlyodds(f, s) = all(c -> f(c), s[1:2:length(s)]) && !any(c -> f(c), s[2:2:length(s)])
4,111

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.