Alternade words: Difference between revisions
Content added Content deleted
Alpha bravo (talk | contribs) (Added AutoHotkey) |
(add FreeBASIC) |
||
Line 1,234: | Line 1,234: | ||
truant tun rat |
truant tun rat |
||
twirly til wry |
twirly til wry |
||
</pre> |
|||
=={{header|FreeBASIC}}== |
|||
<lang freebasic>#define DLEN 25104 |
|||
function is_in(word() as string, s as string) as boolean |
|||
for i as uinteger = 1 to DLEN |
|||
if word(i)=s then return true |
|||
next i |
|||
return false |
|||
end function |
|||
dim as string word(1 to DLEN), alt(0 to 1) |
|||
dim as integer i, j |
|||
open "unixdict.txt" for input as #1 |
|||
while not eof(1) |
|||
i+=1 |
|||
line input #1, word(i) |
|||
wend |
|||
close #1 |
|||
for i = 1 to DLEN |
|||
if len(word(i))<6 then continue for |
|||
alt(0) = "" |
|||
alt(1) = "" |
|||
for j = 1 to len(word(i)) |
|||
alt(j mod 2) += mid(word(i),j, 1) |
|||
next j |
|||
if is_in(word(), alt(0)) and is_in(word(), alt(1)) then print word(i), alt(1), alt(0) |
|||
next i</lang> |
|||
{{out}}<pre> |
|||
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> |
</pre> |
||