Add three consecutive letters of the alphabet into the group of letters below, without splitting the consecutive letters, to form another word.
CAY
(In reply to
Other examples by Jyqm)
aSTUte
siGHIng
DEFray
HIJinks
airbuRSTs (only one found)
from the likes of:
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
crlf = Chr(13) + Chr(10)
Form1.Visible = True
Text1.Text = ""
alpha$ = "abcdefghijklmnopqrstuvwxyz"
For i = 1 To 24
intron$ = Mid(alpha, i, 3)
For p = 0 To 6
w$ = Mid("airbus", 1, p) + intron + Mid("airbus", p + 1)
If isWord(w) Then Text1.Text = Text1.Text & w & crlf
Next
Next
Text1.Text = Text1.Text & crlf & " done"
End Sub
Function isWord(w$)
n = Len(w$)
If n = 0 Then isWord = 0: Exit Function
w1$ = Space$(n)
Open "c:\words\words" + LTrim$(Str$(n)) + ".txt" For Binary As #2
l = LOF(2) / n
low = 1: high = l
Do
middle = Int((low + high) / 2)
Get #2, (middle - 1) * n + 1, w1$
If w1$ = w$ Then isWord = 1: Close 2: Exit Function
If w1$ < w$ Then low = middle + 1 Else high = middle - 1
Loop Until low > high
isWord = 0
Close 2
End Function
|
Posted by Charlie
on 2015-05-21 10:49:16 |