Jun 16th, 2004, 09:40 AM
#1
Thread Starter
New Member
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 .
Jun 16th, 2004, 10:01 AM
#2
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
Jun 16th, 2004, 10:16 AM
#3
http://www.vbforums.com/showthread.p...hreadid=292642
Change,
VB Code:
Private Const charz As String = "abcdefghijklmnopqrstuvwxyz0123456789"
to
VB Code:
Private Const charz As String = "abcdefghijklmnopqrstuvwxyz
Jun 16th, 2004, 10:45 AM
#4
Thread Starter
New Member
Thanks Jmacp cheers.
[RESOLVED]
Jun 16th, 2004, 11:32 AM
#5
Thread Starter
New Member
Can someone make me a .exe with this code? or tell me how to make this into a .exe?
VB Code:
Option Explicit
Private BOOLER As Boolean
Private numofperms As Single
Private comboz As String
Private myarray() As Byte
Private Const charz As String = "abcdefghijklmnopqrstuvwxyz"
Private Function APPPATH() As String
If Right$(App.Path, 1) "\" Then
APPPATH = App.Path & "\"
Else
APPPATH = App.Path
End If
End Function
Private Sub command1_Click()
BOOLER = False
Open APPPATH & "combos.txt" For Output As #1
Call GETALLCOMBOZ(charz, 4) ' 4 = number of character combinations to try
numofperms = 1
End Sub
Public Sub GETALLCOMBOZ(ByVal charact As String, _
ByVal num As Byte)
ReDim myarray(num)
Do While Not (BOOLER)
myarray(numofperms) = myarray(numofperms) + 1
If numofperms = num Then
comboz = Left$(comboz, num - 1) + Mid$(charact, myarray(numofperms), 1)
Else
comboz = comboz + Mid$(charact, myarray(numofperms), 1)
End If
If myarray(numofperms) Len(charact) + 1 Then
If numofperms num Then
numofperms = numofperms + 1
Else
Print #1, comboz
End If
Else
If numofperms = 1 Then
BOOLER = True
Else
myarray(numofperms) = 0
numofperms = numofperms - 1
comboz = Left$(comboz, numofperms - 1)
End If
End If
Loop
Close #1
End Sub
Jun 16th, 2004, 11:47 AM
#6
Banned
Jun 16th, 2004, 12:04 PM
#7
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
Forum Rules
Click Here to Expand Forum to Full Width