Jump to content

Recommended Posts

Posted

I’m comfortable with autoit but I’ve run into a wall. I can’t think of a method on how to generate all unique combinations of a-z at 3 characters long

aaa

aab

etc

Posted
$Letters  = StringSplit("a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z", ",")
Combi("", 3)

Func Combi($Str, $MaxLen)
  if StringLen($Str) = $MaxLen Then
    FileWriteLine("Test.txt", "Letters list = " & $Str)
    Return
  EndIf
  For $i = 1 to $Letters[0]
    Combi($Str & $Letters[$i], $MaxLen)
  Next
EndFunc

 

Posted (edited)
$A = 65
For $i = 0 to 25
    For $j= 0 to 25
        For $k = 0 to 25
            ConsoleWrite(Chr($A+$i) & Chr($A+$j) & Chr($A+$k) & @CRLF)
        Next
    Next
Next

Edit: didn't know why I put in 32...25 starting from 0 is correct.

 

I do like the recursion used in the other example though.

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...