Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7615429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:38:34+00:00 2026-05-31T02:38:34+00:00

EDIT NOTE: I’ve not been very clear. I’m trying to start from a single

  • 0

EDIT NOTE: I’ve not been very clear. I’m trying to start from a single char guess such as 0 to 00 to 000 … all the way through to zzzzzz. Basically, all possible iterations from 0 to zzzzzz. Sorry I’ve not been very clear!

I’m currently trying to cycle through an array of characters. The array contains 0-9 and a-z (lower case). Admittedly, this is homework – I’m a useless coder (see previous post) and I could do with a bit of help.

What I want is to iterate through all possible results of the char array and list the results…

aaa                aba
aab > through to > aca
aac                ada

If it were just based on letters I’ve read that I could base it on base26 number system but this includes numbers.

So far, I’ve managed to cycle through the array, assign the answer to a ‘guess’ array before cycling through at the next position. After that, I’m stumped.

Any advice, as last time, much appreciated. The work is based on Brute Force but there are plenty of working examples out there for me to use if my true aim was illegal, but it’s not.

Here is what I have so far.

/**
 *
 * @author Aaron
 */
public class Test {

    /**
     * @param args the command line arguments
     */
    int current = 0;
    char[] guess = new char[6];

    public static void main(String[] args) {
        Test test = new Test();
        int maxLength = 6; 
        char c = '0';

        while (maxLength != 0) {
            maxLength--;
            test.iterateAll(c);
            test.increment(c);            
        }
    }

    public void iterateAll(char c) {
        char[] charset = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
                          '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'};
        for (int i = 0; i < charset.length; i++) {
            //c = charset[i];
            guess[current] = charset[i];
            System.out.println(guess);
        }
    }

    public void increment(char c) {
        current++;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T02:38:35+00:00Added an answer on May 31, 2026 at 2:38 am

    Can you use Integer.toString()? If so, it’s willing to do most of the work for you. The following prints aaa, aab, aac, etc. for everything.

    final int start = 36*36*10 + (36*10) + 10;
    for (int i = start; i < 36*36*36; ++i) {
        final String base36 = Integer.toString(i, 36);
        final String padded = String.format("%3s", base36).replace(' ', '0');
        System.out.println(padded);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: Note to new Perl programmers : This mechanism should NOT be used for
EDIT: Note. I should have mentioned I'm not interested in using the .Select, DataRowView,
[Edit] Note: These projects are projects that I have copied and renamed. Not sure
Edit : Note that my final purpose here is not having the class working,
Please note the Edit below for a lot more information, and a possible solution
Edit: From another question I provided an answer that has links to a lot
EDIT: Learned that Webmethods actually uses NLST, not LIST, if that matters Our business
EDIT: Note that due to the way hard drives actually write data, none of
-edit- NOTE the ? at the end of .{2,}? I found out you can
EDIT: Note! This turned out to be a typo in my code According to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.