Anagram Function 4>15 length v1.07

Post your working scripts, libraries and tools
User avatar
littlegandhi1199
Posts: 187
Joined: 29 Aug 2016, 23:58

Anagram Function 4>15 length v1.07

29 Jun 2020, 15:15

You can see the fun GUI for this over here
https://www.autohotkey.com/boards/viewtopic.php?f=19&t=34285

Here it is in just function form. Little hacky using global. Just starting to get used to functions though...
I hope the variables don't cross over to your main script! I'm not sure if they do or not when I use global.
I attached a few dictionaries of which I'm using the _22k one which is common words as noted inside "12dicts American 3esl" but only if they appear in the words_alpha master 400k words list which doesn't allow punctuation.
Select one and rename it to "words.txt"

Common
http://wordlist.aspell.net/12dicts/
Full-ALPHA
https://github.com/dwyl/english-words





v1.07 - more bugfixes. patched GUI version and this one



Example Script

Code: Select all

SetBatchLines, -1

#include words_func.ahk

Pre := A_TickCount
total := Startup()
Post := A_TickCount-Pre
Post := Post/1000
msgbox, Startup took %Post%s`n%total% words added to dictionary!

Lookup =
(
Pastel
characterize
insufficient
apologeticalyl
)



Loop, parse, Lookup, `n
{
word := A_Loopfield
Array := Function(word)
If (Array != "")
{
loop, 12
{
Length := A_Index+3

if ObjHasKey(Array, Length)
{
thisExtra := Array[Length]
If (Array[Length] > 0)
{
some = %Length%var
out := Array[some]
msgbox, "%word%"`n%Length%s ===`n%out%
}
}
Else
	thisExtra =


%Length%Length := thisExtra
}


msgbox, "%word%"`n[%4Length%] 4s`n[%5Length%] 5s`n[%6Length%] 6s`n[%7Length%] 7s`n[%8Length%] 8s`n[%9Length%] 9s`n[%10Length%] 10s`n[%11Length%] 11s`n[%12Length%] 12s`n[%13Length%] 13s`n[%14Length%] 14s`n[%15Length%] 15s
}
}



words_func.ahk

Code: Select all

Startup()
{
global
FileRead, Bin, words.txt
Sort, Bin, U
Stringlower, Bin, Bin
dict:=[]
Loop, Parse, Bin, `n
{
maxindexzz := A_Index
stringtrimright, field, A_LoopField, 1
newparse =
loop, parse, field
	newparse = %newparse%`n%A_loopfield%
sort, newparse
newparse := StrReplace(newparse, "`n", "")
if ObjHasKey(dict, newparse)
{
conten := dict[newparse]
conten = %conten%,%field%
dict[newparse] := conten
}
else
	dict[newparse] := field
}
sometzzzz := StrLen(maxindexzz)
sometzzzz /= 3
sometzzzz := Floor(sometzzzz)
loop
{
if (A_Index > sometzzzz)
{
if (StrLen(maxindexzz) > 0)
	lovesmax = %maxindexzz%,%lovesmax%
break
}
stringtrimleft, maxindexzze, maxindexzz, % StrLen(maxindexzz)-3
stringtrimright, maxindexzz, maxindexzz, 3
lovesmax = %maxindexzze%,%lovesmax%
}
stringtrimright, lovesmax, lovesmax, 1
return lovesmax
}











Function(FirstName)
{
global
saveArray =
saveArray := []

let := 1
add := 0
Array =
Array := Object()


last = %FirstName%
input = %FirstName%
loop
{
stringtrimright, zinput, input, % StrLen(input)-1
stringtrimleft, input, input, 1
cont := zinput
if (cont = "")
	break
Array[A_Index] := zinput
}







revpr := A_TickCount
yes := strlen(FirstName)
bet := yes-4
bet++
var = %FirstName%
newpar =
newparse =
loop, parse, var
	newparse = %newparse%`n%A_loopfield%
sort, newparse
newparse := StrReplace(newparse, "`n", "")

;;msgbox, Checking flat out "%newparse%"

newpar = %newpar%`n%newparse%
if ObjHasKey(dict, newparse)
{
cont := dict[newparse]
cont := StrReplace(cont, ",", "`n")
var2 = %var2%`n%cont%
;;msgbox, Direct anagram "%var2%"
}
Fix = `n%FirstName%
var2 := StrReplace(var2, Fix)
if (var2 != "")
	var2 = `n%var2%
tempvar := var2
Sort, tempvar, U
StrReplace(tempvar, "`n", "`n", OutputVarCount)
;;GuiControl,, MyEdit%bet%, %OutputVarCount% anagrams!`n%tempvar%
if (OutputVarCount < 1)
	noth = 1
else
{
saveDIRECT = %yes%var
saveArray[yes] := OutputVarCount
saveArray[saveDIRECT] := tempvar
}
tempvar =
var2 =
;;fileappend, %newpar%`n, test%bet%.txt
newpar =
;;;;;;;;;;;;;;;;;;;;;;;;;; 4
skip := Array.MaxIndex()
let1 := let+2
skip -= let1
;;msgbox, let=[%let%]`nlet1=[%let1%]`nskip=[%skip%]`n...on first 4 legnth run
loop, % Array.MaxIndex()
{
if (A_Index > skip)
	break
Entry =
Entry := Object()
a := Array[A_Index]
entry[1] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index))
	continue
b := Array[A_Index]
entry[2] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index))
	continue
c := Array[A_Index]
entry[3] := A_Index
z = %a%%b%%c%
let := 1
themaster()
}
}
}
tempvar := var2
Sort, tempvar, U
StrReplace(tempvar, "`n", "`n", OutputVarCount)
if (OutputVarCount < 1)
	noth = 1
else
{
;;msgbox, %Let% === %OutputVarCount% anagrams!`n%tempvar%
saveArray[4] := OutputVarCount
saveArray["4var"] := tempvar
}
tempvar =
var2 =
;;fileappend, %newpar%`n, test%let%.txt
newpar =
bet := let+5
if (bet > strLen(FirstName))
{
;;msgbox, not gonna bother checking %bet%s
return saveArray
}
;;;;;;;;;;;;;;;;;;;;;;;;;; 5
skip := Array.MaxIndex()
let1 := let+3
skip -= let1
loop, % Array.MaxIndex()
{
if (A_Index > skip)
	break
entry =
Entry := Object()
a := Array[A_Index]
entry[1] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index))
	continue
b := Array[A_Index]
entry[2] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index))
	continue
c := Array[A_Index]
entry[3] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index))
	continue
d := Array[A_Index]
entry[4] := A_Index
z = %a%%b%%c%%d%
let := 2
themaster()
}
}
}
}
tempvar := var2
Sort, tempvar, U
StrReplace(tempvar, "`n", "`n", OutputVarCount)
if (OutputVarCount < 1)
	noth = 1
else
{
;;msgbox, %Let% === %OutputVarCount% anagrams!`n%tempvar%
saveArray[5] := OutputVarCount
saveArray["5var"] := tempvar
}
tempvar =
var2 =
;;fileappend, %newpar%`n, test%let%.txt
newpar =
bet := let+5
if (bet > strLen(FirstName))
{
;;msgbox, not gonna bother checking %bet%s
return saveArray
}
;;;;;;;;;;;;;;;;;;;;;;;;;; 6
skip := Array.MaxIndex()
let1 := let+3
skip -= let1
loop, % Array.MaxIndex()
{
if (A_Index > skip)
	break
entry =
Entry := Object()
a := Array[A_Index]
entry[1] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index))
	continue
b := Array[A_Index]
entry[2] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index))
	continue
c := Array[A_Index]
entry[3] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index))
	continue
d := Array[A_Index]
entry[4] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index))
	continue
e := Array[A_Index]
entry[5] := A_Index
z = %a%%b%%c%%d%%e%
let := 3
themaster()
}
}
}
}
}
tempvar := var2
Sort, tempvar, U
StrReplace(tempvar, "`n", "`n", OutputVarCount)
if (OutputVarCount < 1)
	noth = 1
else
{
;;msgbox, %Let% === %OutputVarCount% anagrams!`n%tempvar%
saveArray[6] := OutputVarCount
saveArray["6var"] := tempvar
}
tempvar =
var2 =
;;fileappend, %newpar%`n, test%let%.txt
newpar =
bet := let+5
if (bet > strLen(FirstName))
{
;;msgbox, not gonna bother checking %bet%s
return saveArray
}
;;dif := A_TickCount-revpr
;;msgbox, %dif%ms to complete
;;;;;;;;;;;;;;;;;;;;;;;;;; 7
skip := Array.MaxIndex()
let1 := let+3
skip -= let1
loop, % Array.MaxIndex()
{
if (A_Index > skip)
	break
entry =
Entry := Object()
a := Array[A_Index]
entry[1] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index))
	continue
b := Array[A_Index]
entry[2] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index))
	continue
c := Array[A_Index]
entry[3] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index))
	continue
d := Array[A_Index]
entry[4] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index))
	continue
e := Array[A_Index]
entry[5] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index))
	continue
f := Array[A_Index]
entry[6] := A_Index
z = %a%%b%%c%%d%%e%%f%
let := 4
themaster()
}
}
}
}
}
}
tempvar := var2
Sort, tempvar, U
StrReplace(tempvar, "`n", "`n", OutputVarCount)
if (OutputVarCount < 1)
	noth = 1
else
{
;;msgbox, %Let% === %OutputVarCount% anagrams!`n%tempvar%
saveArray[7] := OutputVarCount
saveArray["7var"] := tempvar
}
tempvar =
var2 =
;;fileappend, %newpar%`n, test%let%.txt
newpar =
bet := let+5
if (bet > strLen(FirstName))
{
;;msgbox, not gonna bother checking %bet%s
return saveArray
}
;;;;;;;;;;;;;;;;;;;;;;;;;; 8
skip := Array.MaxIndex()
let1 := let+3
skip -= let1
loop, % Array.MaxIndex()
{
if (A_Index > skip)
	break
entry =
Entry := Object()
a := Array[A_Index]
entry[1] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index))
	continue
b := Array[A_Index]
entry[2] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index))
	continue
c := Array[A_Index]
entry[3] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index))
	continue
d := Array[A_Index]
entry[4] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index))
	continue
e := Array[A_Index]
entry[5] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index))
	continue
f := Array[A_Index]
entry[6] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index))
	continue
g := Array[A_Index]
entry[7] := A_Index
z = %a%%b%%c%%d%%e%%f%%g%
let := 5
themaster()
}
}
}
}
}
}
}
tempvar := var2
Sort, tempvar, U
StrReplace(tempvar, "`n", "`n", OutputVarCount)
if (OutputVarCount < 1)
	noth = 1
else
{
;;msgbox, %Let% === %OutputVarCount% anagrams!`n%tempvar%
saveArray[8] := OutputVarCount
saveArray["8var"] := tempvar
}
tempvar =
var2 =
;;fileappend, %newpar%`n, test%let%.txt
newpar =
bet := let+5
if (bet > strLen(FirstName))
{
;;msgbox, not gonna bother checking %bet%s
return saveArray
}
;;;;;;;;;;;;;;;;;;;;;;;;;; 9
skip := Array.MaxIndex()
let1 := let+3
skip -= let1
loop, % Array.MaxIndex()
{
if (A_Index > skip)
	break
entry =
Entry := Object()
a := Array[A_Index]
entry[1] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index))
	continue
b := Array[A_Index]
entry[2] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index))
	continue
c := Array[A_Index]
entry[3] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index))
	continue
d := Array[A_Index]
entry[4] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index))
	continue
e := Array[A_Index]
entry[5] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index))
	continue
f := Array[A_Index]
entry[6] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index))
	continue
g := Array[A_Index]
entry[7] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index))
	continue
h := Array[A_Index]
entry[8] := A_Index
z = %a%%b%%c%%d%%e%%f%%g%%h%
let := 6
themaster()
}
}
}
}
}
}
}
}
tempvar := var2
Sort, tempvar, U
StrReplace(tempvar, "`n", "`n", OutputVarCount)
if (OutputVarCount < 1)
	noth = 1
else
{
;;msgbox, %Let% === %OutputVarCount% anagrams!`n%tempvar%
saveArray[9] := OutputVarCount
saveArray["9var"] := tempvar
}
tempvar =
var2 =
;;fileappend, %newpar%`n, test%let%.txt
newpar =
bet := let+5
if (bet > strLen(FirstName))
{
;;msgbox, not gonna bother checking %bet%s
return saveArray
}
;;;;;;;;;;;;;;;;;;;;;;;;;; 10
skip := Array.MaxIndex()
let1 := let+3
skip -= let1
loop, % Array.MaxIndex()
{
if (A_Index > skip)
	break
entry =
Entry := Object()
a := Array[A_Index]
entry[1] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index))
	continue
b := Array[A_Index]
entry[2] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index))
	continue
c := Array[A_Index]
entry[3] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index))
	continue
d := Array[A_Index]
entry[4] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index))
	continue
e := Array[A_Index]
entry[5] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index))
	continue
f := Array[A_Index]
entry[6] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index))
	continue
g := Array[A_Index]
entry[7] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index))
	continue
h := Array[A_Index]
entry[8] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index) || (entry[8] >= A_Index))
	continue
i := Array[A_Index]
entry[9] := A_Index
z = %a%%b%%c%%d%%e%%f%%g%%h%%i%
let := 7
themaster()
}
}
}
}
}
}
}
}
}
tempvar := var2
Sort, tempvar, U
StrReplace(tempvar, "`n", "`n", OutputVarCount)
if (OutputVarCount < 1)
	noth = 1
else
{
;;msgbox, %Let% === %OutputVarCount% anagrams!`n%tempvar%
saveArray[10] := OutputVarCount
saveArray["10var"] := tempvar
}
tempvar =
var2 =
newpar =
bet := let+5
if (bet > strLen(FirstName))
{
;;msgbox, not gonna bother checking %bet%s
return saveArray
}
;;;;;;;;;;;;;;;;;;;;;;;;;; 11
skip := Array.MaxIndex()
let1 := let+3
skip -= let1
loop, % Array.MaxIndex()
{
if (A_Index > skip)
	break
entry =
Entry := Object()
a := Array[A_Index]
entry[1] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index))
	continue
b := Array[A_Index]
entry[2] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index))
	continue
c := Array[A_Index]
entry[3] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index))
	continue
d := Array[A_Index]
entry[4] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index))
	continue
e := Array[A_Index]
entry[5] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index))
	continue
f := Array[A_Index]
entry[6] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index))
	continue
g := Array[A_Index]
entry[7] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index))
	continue
h := Array[A_Index]
entry[8] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index) || (entry[8] >= A_Index))
	continue
i := Array[A_Index]
entry[9] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index) || (entry[8] >= A_Index) || (entry[9] >= A_Index))
	continue
j := Array[A_Index]
entry[10] := A_Index
z = %a%%b%%c%%d%%e%%f%%g%%h%%i%%j%
let := 8
themaster()
}
}
}
}
}
}
}
}
}
}
tempvar := var2
Sort, tempvar, U
StrReplace(tempvar, "`n", "`n", OutputVarCount)
if (OutputVarCount < 1)
	noth = 1
else
{
;;msgbox, %Let% === %OutputVarCount% anagrams!`n%tempvar%
saveArray[11] := OutputVarCount
saveArray["11var"] := tempvar
}
tempvar =
var2 =
newpar =
bet := let+5
if (bet > strLen(FirstName))
{
;;msgbox, not gonna bother checking %bet%s
return saveArray
}
;;;;;;;;;;;;;;;;;;;;;;;;;; 12
skip := Array.MaxIndex()
let1 := let+3
skip -= let1
loop, % Array.MaxIndex()
{
if (A_Index > skip)
	break
entry =
Entry := Object()
a := Array[A_Index]
entry[1] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index))
	continue
b := Array[A_Index]
entry[2] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index))
	continue
c := Array[A_Index]
entry[3] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index))
	continue
d := Array[A_Index]
entry[4] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index))
	continue
e := Array[A_Index]
entry[5] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index))
	continue
f := Array[A_Index]
entry[6] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index))
	continue
g := Array[A_Index]
entry[7] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index))
	continue
h := Array[A_Index]
entry[8] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index) || (entry[8] >= A_Index))
	continue
i := Array[A_Index]
entry[9] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index) || (entry[8] >= A_Index) || (entry[9] >= A_Index))
	continue
j := Array[A_Index]
entry[10] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index) || (entry[8] >= A_Index) || (entry[9] >= A_Index) || (entry[10] >= A_Index))
	continue
k := Array[A_Index]
entry[11] := A_Index
z = %a%%b%%c%%d%%e%%f%%g%%h%%i%%j%%k%
let := 9
themaster()
}
}
}
}
}
}
}
}
}
}
}
tempvar := var2
Sort, tempvar, U
StrReplace(tempvar, "`n", "`n", OutputVarCount)
if (OutputVarCount < 1)
	noth = 1
else
{
;;msgbox, %Let% === %OutputVarCount% anagrams!`n%tempvar%
saveArray[12] := OutputVarCount
saveArray["12var"] := tempvar
}
tempvar =
var2 =
;;fileappend, %newpar%`n, test%let%.txt
newpar =
bet := let+5
if (bet > strLen(FirstName))
{
;;msgbox, not gonna bother checking %bet%s
return saveArray
}
;;;;;;;;;;;;;;;;;;;;;;;;;; 13
skip := Array.MaxIndex()
let1 := let+3
skip -= let1
loop, % Array.MaxIndex()
{
if (A_Index > skip)
	break
entry =
Entry := Object()
a := Array[A_Index]
entry[1] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index))
	continue
b := Array[A_Index]
entry[2] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index))
	continue
c := Array[A_Index]
entry[3] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index))
	continue
d := Array[A_Index]
entry[4] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index))
	continue
e := Array[A_Index]
entry[5] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index))
	continue
f := Array[A_Index]
entry[6] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index))
	continue
g := Array[A_Index]
entry[7] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index))
	continue
h := Array[A_Index]
entry[8] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index) || (entry[8] >= A_Index))
	continue
i := Array[A_Index]
entry[9] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index) || (entry[8] >= A_Index) || (entry[9] >= A_Index))
	continue
j := Array[A_Index]
entry[10] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index) || (entry[8] >= A_Index) || (entry[9] >= A_Index) || (entry[10] >= A_Index))
	continue
k := Array[A_Index]
entry[11] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index) || (entry[8] >= A_Index) || (entry[9] >= A_Index) || (entry[10] >= A_Index) || (entry[11] >= A_Index))
	continue
l := Array[A_Index]
entry[12] := A_Index
z = %a%%b%%c%%d%%e%%f%%g%%h%%i%%j%%k%%l%
let := 10
themaster()
}
}
}
}
}
}
}
}
}
}
}
}
tempvar := var2
Sort, tempvar, U
StrReplace(tempvar, "`n", "`n", OutputVarCount)
if (OutputVarCount < 1)
	noth = 1
else
{
;;msgbox, %Let% === %OutputVarCount% anagrams!`n%tempvar%
saveArray[13] := OutputVarCount
saveArray["13var"] := tempvar
}
tempvar =
var2 =
;;fileappend, %newpar%`n, test%let%.txt
newpar =
bet := let+5
if (bet > strLen(FirstName))
{
;;msgbox, not gonna bother checking %bet%s
return saveArray
}
;;;;;;;;;;;;;;;;;;;;;;;;;; 14
skip := Array.MaxIndex()
let1 := let+3
skip -= let1
loop, % Array.MaxIndex()
{
if (A_Index > skip)
	break
entry =
Entry := Object()
a := Array[A_Index]
entry[1] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index))
	continue
b := Array[A_Index]
entry[2] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index))
	continue
c := Array[A_Index]
entry[3] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index))
	continue
d := Array[A_Index]
entry[4] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index))
	continue
e := Array[A_Index]
entry[5] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index))
	continue
f := Array[A_Index]
entry[6] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index))
	continue
g := Array[A_Index]
entry[7] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index))
	continue
h := Array[A_Index]
entry[8] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index) || (entry[8] >= A_Index))
	continue
i := Array[A_Index]
entry[9] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index) || (entry[8] >= A_Index) || (entry[9] >= A_Index))
	continue
j := Array[A_Index]
entry[10] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index) || (entry[8] >= A_Index) || (entry[9] >= A_Index) || (entry[10] >= A_Index))
	continue
k := Array[A_Index]
entry[11] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index) || (entry[8] >= A_Index) || (entry[9] >= A_Index) || (entry[10] >= A_Index) || (entry[11] >= A_Index))
	continue
l := Array[A_Index]
entry[12] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index) || (entry[8] >= A_Index) || (entry[9] >= A_Index) || (entry[10] >= A_Index) || (entry[11] >= A_Index) || (entry[12] >= A_Index))
	continue	
m := Array[A_Index]
entry[13] := A_Index
z = %a%%b%%c%%d%%e%%f%%g%%h%%i%%j%%k%%l%%m%
let := 11
themaster()
}
}
}
}
}
}
}
}
}
}
}
}
}
tempvar := var2
Sort, tempvar, U
StrReplace(tempvar, "`n", "`n", OutputVarCount)
if (OutputVarCount < 1)
	noth = 1
else
{
;;msgbox, %Let% === %OutputVarCount% anagrams!`n%tempvar%
saveArray[14] := OutputVarCount
saveArray["14var"] := tempvar
}
tempvar =
var2 =
;;fileappend, %newpar%`n, test%let%.txt
newpar =
bet := let+5
if (bet > strLen(FirstName))
{
;;msgbox, not gonna bother checking %bet%s
return saveArray
}
;;;;;;;;;;;;;;;;;;;;;;;;;; 15
skip := Array.MaxIndex()
let1 := let+3
skip -= let1
loop, % Array.MaxIndex()
{
if (A_Index > skip)
	break
entry =
Entry := Object()
a := Array[A_Index]
entry[1] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index))
	continue
b := Array[A_Index]
entry[2] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index))
	continue
c := Array[A_Index]
entry[3] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index))
	continue
d := Array[A_Index]
entry[4] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index))
	continue
e := Array[A_Index]
entry[5] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index))
	continue
f := Array[A_Index]
entry[6] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index))
	continue
g := Array[A_Index]
entry[7] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index))
	continue
h := Array[A_Index]
entry[8] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index) || (entry[8] >= A_Index))
	continue
i := Array[A_Index]
entry[9] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index) || (entry[8] >= A_Index) || (entry[9] >= A_Index))
	continue
j := Array[A_Index]
entry[10] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index) || (entry[8] >= A_Index) || (entry[9] >= A_Index) || (entry[10] >= A_Index))
	continue
k := Array[A_Index]
entry[11] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index) || (entry[8] >= A_Index) || (entry[9] >= A_Index) || (entry[10] >= A_Index) || (entry[11] >= A_Index))
	continue
l := Array[A_Index]
entry[12] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index) || (entry[8] >= A_Index) || (entry[9] >= A_Index) || (entry[10] >= A_Index) || (entry[11] >= A_Index) || (entry[12] >= A_Index))
	continue
m := Array[A_Index]
entry[13] := A_Index
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index) || (entry[8] >= A_Index) || (entry[9] >= A_Index) || (entry[10] >= A_Index) || (entry[11] >= A_Index) || (entry[12] >= A_Index) || (entry[13] >= A_Index))
	continue	
n := Array[A_Index]
entry[14] := A_Index
z = %a%%b%%c%%d%%e%%f%%g%%h%%i%%j%%k%%l%%m%%n%
let := 12
themaster()
}
}
}
}
}
}
}
}
}
}
}
}
}
}
tempvar := var2
Sort, tempvar, U
StrReplace(tempvar, "`n", "`n", OutputVarCount)
if (OutputVarCount < 1)
	noth = 1
else
{
;;msgbox, %Let% === %OutputVarCount% anagrams!`n%tempvar%
saveArray[15] := OutputVarCount
saveArray["15var"] := tempvar
}
tempvar =
var2 =
;;fileappend, %newpar%`n, test%let%.txt
newpar =


return SaveArray
}
;;;;;;ButtonOK complete?

















themaster()
{
global
loop, % Array.MaxIndex()
{
if ((entry[1] >= A_Index) || (entry[2] >= A_Index) || (entry[3] >= A_Index) || (entry[4] >= A_Index) || (entry[5] >= A_Index) || (entry[6] >= A_Index) || (entry[7] >= A_Index) || (entry[8] >= A_Index) || (entry[9] >= A_Index) || (entry[10] >= A_Index) || (entry[11] >= A_Index) || (entry[12] >= A_Index) || (entry[13] >= A_Index) || (entry[14] >= A_Index) || (entry[15] >= A_Index))
	continue
what := Array[A_Index]
var = %z%%what%


newparse =
loop, parse, var
	newparse = %newparse%`n%A_loopfield%
sort, newparse
newparse := StrReplace(newparse, "`n", "")

if ObjHasKey(dict, newparse)
{
cont := dict[newparse]
cont := StrReplace(cont, ",", "`n")
var2 = %var2%`n%cont%
}
}
}
Script Backups on every Execution :mrgreen:
https://www.autohotkey.com/boards/viewtopic.php?f=6&t=75767&p=328155#p328155

Scrabble Solver 4-15 letter word outputs ( :crazy: # of inputs)
https://www.autohotkey.com/boards/viewtopic.php?f=19&t=34285

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 14 guests