Results 1 to 7 of 7

Thread: Random 4 letter Generator HELP

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2004
    Location
    Raleigh, NC
    Posts
    4

    Question Random 4 letter Generator HELP

    Ok, before I made this thread I was sure to use search to look for other topics, and I could'nt find any that helped so here it goes:

    Could someone give me a source code to make a .exe that generates all possible 4 letters.

    ex. aaas, kosd, aosd, siad, asjd...and so on.

    I know it's pretty easy, I just can't find the source anywhere.

    I know all I'm asking is for the source to generate 4 letters, but I would also like all the generated 4's to be saved for a .txt. Like a save option as in a "Save" button in the .exe. Thanks
    Last edited by Moronic; Jun 16th, 2004 at 11:32 AM.

  2. #2
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787
    just randomize 0 to 25 (26 numbers) 4 times and each time pick the corosponding letter to the number so 3 = c etc

    then to save to txt file search the forum its EVERYWHERE

  3. #3
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959
    http://www.vbforums.com/showthread.p...hreadid=292642

    Change,

    VB Code:
    1. Private Const charz     As String = "abcdefghijklmnopqrstuvwxyz0123456789"

    to

    VB Code:
    1. Private Const charz     As String = "abcdefghijklmnopqrstuvwxyz

  4. #4

    Thread Starter
    New Member
    Join Date
    Jun 2004
    Location
    Raleigh, NC
    Posts
    4
    Thanks Jmacp cheers.

    [RESOLVED]

  5. #5

    Thread Starter
    New Member
    Join Date
    Jun 2004
    Location
    Raleigh, NC
    Posts
    4
    Can someone make me a .exe with this code? or tell me how to make this into a .exe?

    VB Code:
    1. Option Explicit
    2. Private BOOLER          As Boolean
    3. Private numofperms      As Single
    4. Private comboz          As String
    5. Private myarray()       As Byte
    6. Private Const charz     As String = "abcdefghijklmnopqrstuvwxyz"
    7.  
    8. Private Function APPPATH() As String
    9.  
    10.     If Right$(App.Path, 1)  "\" Then
    11.         APPPATH = App.Path & "\"
    12.      Else
    13.         APPPATH = App.Path
    14.     End If
    15.  
    16. End Function
    17.  
    18. Private Sub command1_Click()
    19.  
    20.     BOOLER = False
    21.     Open APPPATH & "combos.txt" For Output As #1
    22.     Call GETALLCOMBOZ(charz, 4)  ' 4 = number of character combinations to try
    23.     numofperms = 1
    24.  
    25. End Sub
    26.  
    27. Public Sub GETALLCOMBOZ(ByVal charact As String, _
    28.                   ByVal num As Byte)
    29.  
    30.     ReDim myarray(num)
    31.     Do While Not (BOOLER)
    32.         myarray(numofperms) = myarray(numofperms) + 1
    33.         If numofperms = num Then
    34.             comboz = Left$(comboz, num - 1) + Mid$(charact, myarray(numofperms), 1)
    35.          Else
    36.             comboz = comboz + Mid$(charact, myarray(numofperms), 1)
    37.         End If
    38.         If myarray(numofperms)  Len(charact) + 1 Then
    39.             If numofperms  num Then
    40.                 numofperms = numofperms + 1
    41.              Else
    42.                Print #1, comboz
    43.             End If
    44.          Else
    45.             If numofperms = 1 Then
    46.                 BOOLER = True
    47.              Else
    48.                 myarray(numofperms) = 0
    49.                 numofperms = numofperms - 1
    50.                 comboz = Left$(comboz, numofperms - 1)
    51.             End If
    52.         End If
    53.     Loop
    54.     Close #1
    55.  
    56. End Sub

  6. #6
    File> Make ...

  7. #7
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959
    try this,
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width