Consider a string of three successive letters in reverse order – like zyx, kji etc. Our objective is to add some letters before and after the string to form a valid word.
What is the longest word formed by this process?
antiFEDeralists 15
corresPONdences 15
corresPONdencies 16
corresPONdingly 15
counterresPONse 15
counterresPONses 16
disillusiONMent 15
disillusiONMents 16
envirONMentalism 16
envirONMentalisms 17
envirONMentalist 16
envirONMentalists 17
envirONMentally 15
exPONentiations 15
hyperresPONsive 15
imPONderabilities 17
imPONderability 15
irresPONsibilities 18
irresPONsibility 16
irresPONsibleness 17
irresPONsiblenesses 19
irresPONsiveness 16
irresPONsivenesses 18
malapportiONMent 16
malapportiONMents 17
microenvirONMent 16
microenvirONMental 18
microenvirONMents 17
nONManufacturing 16
nONManufacturings 17
nONMaterialistic 16
nONMathematical 15
nONMathematician 16
nONMathematicians 17
nONMatriculated 15
nONMetaphorical 15
nONMetropolitan 15
nONMetropolitans 16
nonsaPONifiable 15
oUTSpokennesses 15
prePONderancies 15
prePONderations 15
reapportiONMent 15
reapportiONMents 16
resPONsibilities 16
resPONsibleness 15
resPONsiblenesses 17
resPONsivenesses 16
saPONaceousness 15
saPONaceousnesses 17
saPONifications 15
sPONtaneousness 15
sPONtaneousnesses 17
unresPONsiveness 16
unresPONsivenesses 18
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
t = Timer
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
Open "c:\words\word.lst" For Input As #1
Do
Line Input #1, l$
If Len(l) > 14 Then
l2$ = Mid(l, 2, Len(l) - 2)
good = 0
For i = 1 To Len(l2) - 2
If Asc(Mid(l2, i, 1)) = Asc(Mid(l2, i + 1, 1)) + 1 And Asc(Mid(l2, i, 1)) = Asc(Mid(l2, i + 2, 1)) + 2 Then
Where = i + 1
good = 1: Exit For
End If
Next
If good Then
Text1.Text = Text1.Text & pad(Left(l, Where - 1) & UCase(Mid(l, Where, 3)) & Mid(l, Where + 3), 22) & Len(l) & crlf
End If
End If
Loop Until EOF(1)
Text1.Text = Text1.Text & crlf & " done " & Timer - t
End Sub
Function pad$(x$, l)
o$ = Left(x$ + Space$(l), l)
pad = o
End Function
|
Posted by Charlie
on 2015-07-10 19:14:53 |