Jump to content

Letter list generator...


Recommended Posts

Ok, so for about an hour now i've been trying to figure out how to make a list of letters like this:

a

b

c

d

...

zzzzy

zzzzz

problem is, because the ascii codes of upper and lower case letters, and numbers are seperated, the code i've got won't work to create a list with all these...

can anyone find a solution to this...?

here's what i've got so far... (couldn't get lots of nested loops to work...):

for $l1 = 97 to 122
    $word = chr($l1)
    ConsoleWrite($word&@CRLF)
next

for $l2 = 97 to 122
    for $l1 = 97 to 122
    $word = chr($l2) & chr($l1)
    ConsoleWrite($word&@CRLF)
    next
next
            
for $l3 = 97 to 122
    for $l2 = 97 to 122
        for $l1 = 97 to 122
        $word = chr($l3) & chr($l2) & chr($l1)
        ConsoleWrite($word&@CRLF)
        next
    next
next

for $l4 = 97 to 122
    for $l3 = 97 to 122
        for $l2 = 97 to 122
            for $l1 = 97 to 122
            $word = chr($l4) & chr($l3) & chr($l2) & chr($l1)
            ConsoleWrite($word&@CRLF)
            next
        next
    next
next

for $l5 = 97 to 122
    for $l4 = 97 to 122
        for $l3 = 97 to 122
            for $l2 = 97 to 122
                for $l1 = 97 to 122
                $word = chr($l5) & chr($l4) & chr($l3) & chr($l2) & chr($l1)
                ConsoleWrite($word&@CRLF)
                next
            next
        next
    next
next
Edited by rabbitkillrun
Link to comment
Share on other sites

  • 1 month later...

sorry for digging up this old topic to answer my own question, but thought it could be useful to another autoit newb in the future...

i just created an array containing all the characters i wanted and went through charList[$i] rather than using char($i)...

i can't see how i managed to miss that before... :) i guess that's what late night programming does to you... :)

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...