Jump to content

Generating words?


Marlo
 Share

Recommended Posts

Hello fellow forumites! i have once again come up with an idea for a script and have been foiled in my efforts by my crappy brain :)

So anyway...I want to make a script that will generate words, simple right? no

So i have an array in my script that contains all the letters of the alphabet (a-z) and what i want to do is cycle through each letter in my script and when it gets to Z it reset back to A and then add a new letter which will then cycle through until it hits Z. When the second one hits Z the first will be set to B and then the second one will cycle again and until it hits Z and etc etc... (maybe a bit like how a clock increments?) and it will keep doing this (adding new letters and cycleing through) until the script is told to stop. So basicly if i run this script for about a year i should end up with a log file with every word in the world in it ^^

So thats my problem. i havnt the foggyiest how i would go about this.

Any theroies would be great.

Regards

Click here for the best AutoIt help possible.Currently Working on: Autoit RAT
Link to comment
Share on other sites

Yeh my description kind of sucks dont it :)

I'll try and simplify it.

If you think of a clock. The secong digits (the minutes) goes from 1-60 and when the minutes reach 60 it will increment the first value (hours) by 1 and then reset the minutes back to 00. Now i want to do this with the alphabet instead of numbers. and each time the alphabet reaches Z it will increment the first value by another letter. So it will go somthing like: A:X -> A:Y -> A:Z -> B:A -> B:B and it will do this until both letters reach Z (Z:Z) And when this happens it will add another letter (A:A:A -> A:A::)

This is the best way i can describe it =(

Nested for loops wouldnt be possible i dont think as id have to add a loop per letter which would restrict it as i want it to do it automatically.

Hope you understand now :D7

Click here for the best AutoIt help possible.Currently Working on: Autoit RAT
Link to comment
Share on other sites

after some hours of hard work, here it is:

Global $HOWMANYTIMES = 3            ; 2 = A:A, 3 = A:A:A...
Global $Times[$HOWMANYTIMES]

Global $aPos = $HOWMANYTIMES - 1
Global $iPos = 0

For $i = 0 To $HOWMANYTIMES - 1
    $Times[$i] = 65
Next

For $x = 0 To (26 ^ $HOWMANYTIMES) - 1
    For $z = 0 To $HOWMANYTIMES -1
        ConsoleWrite( (Chr($Times[$z]) & ':'))
        If $z = $HOWMANYTIMES - 1 Then
            ConsoleWrite(@LF)
        EndIf
    Next
    
    If $Times[$aPos] < 91 Then
        $Times[$aPos] = $Times[$aPos] + 1
    EndIf
    
    For $b = $aPos To 0 Step -1
        If $Times[$b] = 91 Then
            $Times[$b] = 65
            If $b = 0 Then
                ExitLoop
            EndIf
            $Times[$b - 1] = $Times[$b - 1] + 1
        EndIf
    Next
Next
Link to comment
Share on other sites

This is something I've been thinking about myself - it is easy to make a script to take care of this; you only need to make the generated string long enough (like 25 - 30 characters or more) to get some meaning out of the string.

There are a couple of problems though:

- using 25-30 characters long string will generate alot of combinations (too lazy to attempt to calculate)

- letting this running for an year could end up in filling your hard drive completely ... (or maybe more, maybe less)

- you will need to create a new file once in a while (when the log file gets too big)

... but these can be solved one by one ...

- Considering the huge amount of text lines - how long do you think it will take you to read them and find the meaningful lines? (a scripted search for words among so many lines/characters is out-of-question).

This is the real challenge.

Anyway - I might be wrong in some aspects; nobody is perfect. I wish you good luck with this :)

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

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