Sign in to follow this  
Followers 0
techguy86

Word And Number Generation

3 posts in this topic

I'm trying to make scripts that append information to a txt file.

My number generator works. Takes about 12 hours to append to 5 million. Ends up being about 40 mb in size. If anyone wants it, I'll post a link. I zipped it down to around 775kb.

(i.e.) 0

1

2

...

4999999

5000000

My problem now is trying to make a working word generator, and I'll use the term "word" loosely, I'll give an example.

(i.e.) a

b

c

...

z

aa

ab

ac

...

ba

bb

bc

...

za

zb

zc

...

zz

aaa

aab

aac

...

zzz

and so on to as many characters as possible.

Any help would be greatly appreciated. Posted code also helps. I don't want it to be done for me. I just need some starter code that's been tested to work. My new found friend "gosub" doesn't work all the time. i know how much some of you like version 3 but I'd prefer that that generator be coded in version 2.6x. I :whistle: that if we put our heads together, we can get this script to work. If it works in the end i'll post a link to it on my website, just like Dissolve 1.4.

P.S. Thanks for helping on previous posts I've had.

Computerguy_86


My Programs:Dissolve (Updated 5-30-06)Credit Card Validator (Not created as of yet)Master Lock Combination Cracker (Updated 7-08-07)Go Siteseeing:My Website: - Click HereCyberZeroCool's Website - Click Here

Share this post


Link to post
Share on other sites



Posted this script previously on this forum:

Just fill in the $STR all character you want to use and set the $MLEN to the max length of the words to generate..

This is Version3 code!!

$STR="A,B,C,D,E,F,G,H"
$CHARS=StringSplit($STR,",")
$FILE = FileOpen("test.txt", 2)
$MLEN = 4; max length of the output
$TOUT=""
Dim $NTOUT[$MLEN+1] 
For $X = 1 To $MLEN
   $NTOUT[$X] = Chr(0)
Next
$NTOUT[1] = Chr(0)
; endless loop
While 1=1
   For $X = 1 To $CHARS[0]
      FileWriteLine($FILE, $TOUT & $CHARS[$X] & @LF) 
   Next
   $TOUT=""
   $N2 = 0
   For $X = 1 To $MLEN
      If $X = 1 Then
         $N = Asc($NTOUT[$X]) + 1
      Else
         $N = Asc($NTOUT[$X]) + $N2
      EndIf
      $N2 = 0
      If $N > $CHARS[0] Then
         $N = 1
         $N2 = 1
      EndIf
      $NTOUT[$X]=Chr($N)
      If $N > 0 Then
         $TOUT=$CHARS[$N] & $TOUT
      EndIf
   Next
   If StringLen($TOUT) = $MLEN Then
      ExitLoop
   EndIf
Wend
FileClose($FILE)
Exit

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

JdeB,

Thanks for the code, it worked perfectly! I haven't moved out of my comfort range in terms of AutoIt. I still use 2.64. I used to use batch! :whistle: Eventually I'll learn how to code v.3. For now, well....Thanks again for helping out.

Computerguy_86


My Programs:Dissolve (Updated 5-30-06)Credit Card Validator (Not created as of yet)Master Lock Combination Cracker (Updated 7-08-07)Go Siteseeing:My Website: - Click HereCyberZeroCool's Website - Click Here

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0