Alternade words: Difference between revisions

FutureBasic solution added
(→‎{{header|Vlang}}: Rename "Vlang" in "V (Vlang)")
(FutureBasic solution added)
Line 1,401:
truant tun rat
twirly til wry
</pre>
 
=={{header|FutureBasic}}==
<syntaxhighlight lang="futurebasic">
local fn Words as CFArrayRef
CFURLRef url = fn URLWithString( @"https://web.archive.org/web/20180611003215/http://www.puzzlers.org/pub/wordlists/unixdict.txt" )
CFStringRef string = fn StringWithContentsOfURL( url, NSUTF8StringEncoding, NULL )
end fn = fn StringComponentsSeparatedByCharactersInSet( string, fn CharacterSetNewlineSet )
 
void local fn DoIt
CFArrayRef words = fn Words
CFStringRef wd, wd1, wd2
long length, i
text,,,,, 80
for wd in words
length = len(wd)
if ( length >= 6 )
wd1 = @"" : wd2 = @""
for i = 0 to length-1
if ( i mod 2 == 0 )
wd1 = fn StringByAppendingString( wd1, mid(wd,i,1) )
else
wd2 = fn StringByAppendingString( wd2, mid(wd,i,1) )
end if
next
if ( fn ArrayContainsObject( words, wd1 ) and fn ArrayContainsObject( words, wd2 ) )
print wd,wd1,wd2
end if
end if
next
end fn
 
fn DoIt
 
HandleEvents
</syntaxhighlight>
 
{{out}}
<pre style="height:45ex">
accost acs cot
accuse acs cue
afield ail fed
agleam ala gem
alcott act lot
allele all lee
allied ale lid
alpert apr let
ambient abet min
annette ante net
apport apr pot
ariadne aide ran
assist ass sit
battle btl ate
blaine ban lie
brenda bed rna
calliope clip aloe
choose cos hoe
choosy cos hoy
claire car lie
collude clue old
effete eft fee
fabric fbi arc
fealty fat ely
fluent fun let
forwent fret own
friend fin red
george gog ere
inroad ira nod
israel ire sal
jaunty jut any
joanne jan one
lounge lug one
oriole oil roe
oswald owl sad
parrot pro art
peoria poi era
pierre per ire
poodle pol ode
pounce puc one
racial rca ail
realty rat ely
sordid sri odd
spatial sail pta
sprain sri pan
strain sri tan
strait sri tat
sturdy sud try
sweaty set way
tattle ttl ate
theorem term hoe
though tog huh
throaty tray hot
triode tid roe
triune tin rue
troupe top rue
truant tun rat
twirly til wry
</pre>
 
416

edits