If
Mieleeke were a name of a city in Europe
then by erasing
4 e’s we would get a word
Milk.
Find an edible product such that by inserting four identical letters
into its name we get a name of an European city.
The program uses a list of European cities from Wikipedia and looks for entries with 4 or more occurrences of any given letter:
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
Text1.Text = ""
crlf$ = Chr(13) + Chr(10)
Form1.Visible = True
' ChDir "\VB5 projects\flooble"
Open "cities of europe.txt" For Input As #1
Do
Line Input #1, l$
l$ = LCase$(l$)
For i = 1 To 26
c$ = Mid("abcdefghijklmnopqrstuvwxyz", i, 1)
ct = 0
For j = 1 To Len(l$)
If Mid(l, j, 1) = c Then ct = ct + 1
Next
If ct >= 4 Then
Text1.Text = Text1.Text & l$ & " " & c & crlf
DoEvents
End If
Next i
Loop Until EOF(1)
Text1.Text = Text1.Text & "done" & crlf
End Sub
It finds:
stuttgart t
saint-denis, reunion n
stara zagora a
saint-denis, seine-saint-denis e
saint-denis, seine-saint-denis i
saint-denis, seine-saint-denis n
saint-denis, seine-saint-denis s
The edible word is sugar. With the addition of 4 t's it becomes Stuttgart.
|
Posted by Charlie
on 2015-04-10 11:07:50 |