Generate words from a list of letters
I am attempting to write a program that will take a list of letters (i.e., asdfjkleirugh) and create words (i.e. sad, self, dark, dad, fail, etc.). I want it to be able to create words from 2 to whatever number of letters the user specified. This is what I came up with:
VB Code:
Dim a1 As Long
Dim a2 As Long
Dim a3 As Long
Dim a4 As Long
Dim ConstCombo1 As String
Dim ConstCombo2 As String
Dim ConstCombo3 As String
Dim VolCombo1 As String
Dim WordCombo As String
For a1 = 1 To 10
For a2 = 1 To 4
For a3 = 1 To 10
For a4 = 1 To 10
ConstCombo1 = Choose(a1, "s", "d", "f", "j", "k", "l", "r", "u", "g", "h")
VolCombo1 = Choose(a2, "a", "e", "i", "u")
ConstCombo2 = Choose(a3, "s", "d", "f", "j", "k", "l", "r", "u", "g", "h")
ConstCombo3 = Choose(a4, "s", "d", "f", "j", "k", "l", "r", "u", "g", "h")
WordCombo = ConstCombo1 & VolCombo1 & ConstCombo2 & ConstCombo3
Next a4
Next a3
Next a2
Next a1
Any ideas? Thanks:confused: :confused: :confused: