#include "file.bi" Function String_Split(s_in As String,chars As String,result() As String) As Long Dim As Long ctr,ctr2,k,n,LC=Len(chars) Dim As boolean tally(Len(s_in)) #macro check_instring() n=0 While n0 Then Redim Preserve result(1 To ctr+1) result(ctr+1)=Mid(s_in,k+1-ctr2,ctr2) End If Return Ubound(result) End Function Function loadfile(file As String) As String If Fileexists(file)=0 Then Print file;" not found":Sleep:End Dim As Long f=Freefile Open file For Binary Access Read As #f Dim As String text If Lof(f) > 0 Then text = String(Lof(f), 0) Get #f, , text End If Close #f Return text End Function Function tally(SomeString As String,PartString As String) As Long Dim As Long LenP=Len(PartString),count Dim As Long position=Instr(SomeString,PartString) If position=0 Then Return 0 While position>0 count+=1 position=Instr(position+LenP,SomeString,PartString) Wend Return count End Function Sub show(g As String,file As String,byref matches as long,minsize as long,mustdo as string) Redim As String s() Var L=lcase(loadfile(file)) g=lcase(g) string_split(L,Chr(10),s()) For m As Long=minsize To len(g) For n As Long=Lbound(s) To Ubound(s) If Len(s(n))=m Then For k As Long=0 To m-1 If Instr(g,Chr(s(n)[k]))=0 Then Goto lbl Next k If Instr(s(n),mustdo) Then For j As Long=0 To Len(s(n))-1 If tally(s(n),Chr(s(n)[j]))>tally(g,Chr(s(n)[j])) Then Goto lbl Next j Print s(n) matches+=1 End If End If lbl: Next n Next m End Sub dim as long matches dim as double t=timer show("ndeokgelw","unixdict.txt",matches,3,"k") print print "Overall time taken ";timer-t;" seconds" print matches;" matches" Sleep