-
Notifications
You must be signed in to change notification settings - Fork 79
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
The bug in the video #3
Comments
Hi @kristi-swat, The problem here is how the program convert into integer a non integer number. When you reach the top margin you have max = 1000 and min = 999. As the user tell the program that your number is higher, the program calculate the next guess with (1000+999) / 2 = 999,5, rounding it to 999 and setting it again as the min. I would have fixed this problem using another approach. When you ask the user if a numer is higher or lower than the suggested, there's no reason to put this number as a min or max in the new guess. I didn't run any unit tests to tests the limits of this apporach, but I think is clearer.
|
Hi,
This is not really an issue, but I didn't know where to ask this question, for some reason can't join the discord chat.
I am trying to understand why setting the max to max+1 within Start fixed the bug? That value is supposed to be only within Start method right?
The text was updated successfully, but these errors were encountered: