Results 1 to 2 of 2
Thread: For loops and while loops
- 03-20-2011, 05:30 PM #1
Member
- Join Date
- Mar 2011
- Posts
- 2
- Rep Power
- 0
For loops and while loops
I am an ok java programmer but struggle when it comes to loops.
Im trying to implement a brute force attack at the moment, it can perfrom an attack using a nested For loop. But I am trying to change it to a while loop.
While loops are what I have major issues with.
this is the For loop i have:
for (int e = 0; e < 37; e++) {
bAtt[5] = alphanum[e];
for (int f = 0; f < 37; f++) {
bAtt[4] = alphanum[f];
for (int h = 0; h < 37; h++) {
bAtt[3] = alphanum[h];
for (int g = 0; g < 37; g++) {
bAtt[2] = alphanum[g];
for (int i = 0; i < 37; i++) {
bAtt[1] = alphanum[i];
for (int j = 0; j < 37; j++) {
bAtt[0] = alphanum[j];
if i could get some help as to how someone would approach to do this in a while loop that would be great.
thanks patz.
- 03-20-2011, 05:32 PM #2
Member
- Join Date
- Mar 2011
- Posts
- 2
- Rep Power
- 0
apologies that was unclear
String[] bAtt = new bAtt[6];
String[] alphanum = {"", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
"k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w",
"x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
for (int e = 0; e < 37; e++) {
bAtt[5] = alphanum[e];
for (int f = 0; f < 37; f++) {
bAtt[4] = alphanum[f];
for (int h = 0; h < 37; h++) {
bAtt[3] = alphanum[h];
for (int g = 0; g < 37; g++) {
bAtt[2] = alphanum[g];
for (int i = 0; i < 37; i++) {
bAtt[1] = alphanum[i];
for (int j = 0; j < 37; j++) {
bAtt[0] = alphanum[j];
Similar Threads
-
Help with Loops
By Spyderpig in forum New To JavaReplies: 10Last Post: 02-17-2011, 08:10 AM -
loops
By curioustoknow in forum New To JavaReplies: 3Last Post: 02-06-2011, 01:45 PM -
Help with loops
By pg5678pg in forum New To JavaReplies: 8Last Post: 10-17-2010, 06:51 PM -
these loops...
By Blaedel in forum New To JavaReplies: 0Last Post: 10-01-2009, 06:59 PM -
how to use do while loops
By mikeitalydz in forum New To JavaReplies: 32Last Post: 09-26-2009, 08:30 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks