hola.. tengo un problema con un fuerza bruta...
el tema es asi, tengo 6 letras y necesito ver las combinaciones de todas ellas...
pero no se como hacer a q no se repitan... xq asi el codigo es mucho mas lento :S
x ejemplo asdfgh
con este codigo primero aparece aaaaaa en vez de asdfgh y luego cambiarlas de lugar a x ejemplo asdfhg :S
colocar 2 command button, un timmer con intervalo 0
para hacer funcionar el code presionar el segundo command
Dim cont As Byte
Dim Letras As String
Dim Letra() As String
Dim a As Byte, b As Byte, c As Byte, d As Byte, e As Byte, f As Byte
Dim La As String, Lb As String, Lc As String, Ld As String, Le As String, Lf As String
Private Sub Command1_Click()
Letras = ""
Do While Text1.Text <> ""
Letras = Letras & Left(Text1.Text, 1) & "|"
Text1.Text = Right(Text1.Text, Len(Text1.Text) - 1)
Loop
Letra = Split(Letras, "|")
For a = 0 To 5
La = Letra(a)
For b = 1 To 5
Lb = Letra(b)
For c = 2 To 5
Lc = Letra(c)
For d = 3 To 5
Ld = Letra(d)
For e = 4 To 5
Le = Letra(e)
For f = 5 To 5
Lf = Letra(f)
SendKeys La & Lb & Lc & Ld & Le & Lf
SendKeys "{Enter}"
DoEvents
Next f
Next e
Next d
Next c
Next b
Next a
MsgBox "Termino"
End Sub
Private Sub Command2_Click()
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
If cont = 3 Then
Call Command1_Click
Timer1.Interval = 0
cont = 0
Else
cont = cont + 1
End If
End Sub