Jump to content

How to generate 26^3 in letters using a loop


Teckx
 Share

Recommended Posts

$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

 

Link to comment
Share on other sites

$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.
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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