List five-letters words such that after erasing two letters only one is left.
Word removed
letters
agone ag
alone al
atone at
axone ax
boned bd
boner br
bones bs
boney by
bonne bn
bonze bz
borne br
clone cl
coned cd
cones cs
coney cy
conge cg
conte ct
crone cr
donee de
donne dn
drone dr
gonef gf
goner gr
honed hd
honer hr
hones hs
honey hy
irone ir
jones js
koine ki
krone kr
leone le
loner lr
longe lg
monde md
money my
monie mi
monte mt
nonce nc
nones ns
nonet nt
onces cs
onery ry
onset st
opine pi
ounce uc
ovine vi
owned wd
owner wr
ozone zo
phone ph
ponce pc
pones ps
prone pr
scone sc
shone sh
sonde sd
sones ss
stone st
toned td
toner tr
tones ts
toney ty
tonne tn
trone tr
zoned zd
zoner zr
zones zs
DefDbl A-Z
Dim crlf$, used(5)
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
w$ = Space$(5)
Open "\words\words5.txt" For Binary As #1
Do
DoEvents
Get #1, , w
If EOF(1) Then Exit Do
ix1 = InStr(w, "o")
If ix1 Then
ix2 = InStr(ix1 + 1, w, "n")
If ix2 Then
ix3 = InStr(ix2 + 1, w, "e")
If ix3 Then
Text1.Text = Text1.Text & w & " "
For i = 1 To 5
If i <> ix1 And i <> ix2 And i <> ix3 Then
Text1.Text = Text1.Text & Mid(w, i, 1)
End If
Next
Text1.Text = Text1.Text & crlf
End If
End If
End If
Loop
Close 1
Text1.Text = Text1.Text & crlf & " done"
End Sub
|
Posted by Charlie
on 2015-12-21 10:29:33 |