Find words which contains all the vowels: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
(FutureBasic solution added) |
||
Line 1,019: | Line 1,019: | ||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
ambidextrous |
|||
bimolecular |
|||
cauliflower |
|||
communicable |
|||
communicate |
|||
consanguine |
|||
consultative |
|||
countervail |
|||
exclusionary |
|||
grandiloquent |
|||
importunate |
|||
incommutable |
|||
incomputable |
|||
insupportable |
|||
loudspeaking |
|||
malnourished |
|||
mensuration |
|||
oneupmanship |
|||
pandemonium |
|||
permutation |
|||
perturbation |
|||
portraiture |
|||
praseodymium |
|||
stupefaction |
|||
sulfonamide |
|||
</pre> |
|||
=={{header|FutureBasic}}== |
|||
<syntaxhighlight lang="futurebasic"> |
|||
local fn Words as CFArrayRef |
|||
CFURLRef url = fn URLWithString( @"http://wiki.puzzlers.org/pub/wordlists/unixdict.txt" ) |
|||
CFStringRef string = fn StringWithContentsOfURL( url, NSUTF8StringEncoding, NULL ) |
|||
CFArrayRef array = fn StringComponentsSeparatedByCharactersInSet( string, fn CharacterSetNewlineSet ) |
|||
PredicateRef predicate = fn PredicateWithFormat( @"self.length > %d", 10 ) |
|||
end fn = fn ArrayFilteredArrayUsingPredicate( array, predicate ) |
|||
void local fn DoIt |
|||
CFArrayRef words = fn Words |
|||
CFStringRef wd |
|||
for wd in words |
|||
long index, a = 0, e = 0, i = 0, o = 0, u = 0 |
|||
for index = 0 to len(wd) - 1 |
|||
select ( fn StringCharacterAtIndex( wd, index ) ) |
|||
case _"a" : a++ |
|||
case _"e" : e++ |
|||
case _"i" : i++ |
|||
case _"o" : o++ |
|||
case _"u" : u++ |
|||
end select |
|||
next |
|||
if ( a == 1 and e == 1 and i == 1 and o == 1 and u == 1 ) |
|||
print wd |
|||
end if |
|||
next |
|||
end fn |
|||
fn DoIt |
|||
HandleEvents |
|||
</syntaxhighlight> |
|||
{{out}} |
|||
<pre height="30"> |
|||
ambidextrous |
ambidextrous |
||
bimolecular |
bimolecular |