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

Should it be a max and not min? #152

Open
bkalcho opened this issue Apr 17, 2023 · 0 comments
Open

Should it be a max and not min? #152

bkalcho opened this issue Apr 17, 2023 · 0 comments

Comments

@bkalcho
Copy link

bkalcho commented Apr 17, 2023

In this part of the code, you refer to the boundary for rand.Intn should be min. If it is min then the max generated number will be from [0, min) + 1, meaning that the guess which is > min will not be taken into count.
My understanding is it should be:

max := guess
if guess1 > max {
  max = guess1
}

This way we will evaluate against both guess and guess1.

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