Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not generating all set of codes #1

Open
scoobie opened this issue May 31, 2018 · 1 comment
Open

Not generating all set of codes #1

scoobie opened this issue May 31, 2018 · 1 comment

Comments

@scoobie
Copy link

scoobie commented May 31, 2018

Hello,
I have tried your code, and I´ve noticed that he was missing some specific codes.
To test I have changed the minimum character to "a" and maximum to "z", and we can notice that is not generating a hash for a and starting at "b" when the value is "az", next one should be "aa" but is again "ab". If I move the increment guess after the comparison of the hash, the problem is on the "Z".

@ghost
Copy link

ghost commented Jan 6, 2020

Noticed the same thing. Becomes even more apparent when min is '0' and max is '1'. I think the problem is in the increment function and can be fixed by replacing
guess[x+1] = min_char_value;
with something like

for(int m = x+1;m<guess.length;m++) {
    guess[m] = min_char_value;
}

at least that's how I got it working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant