Stop computer from being able to guess an already guessed number is missing in course

Hello,
I am not sure how to do “Stop computer from being able to guess an already guessed number” or which is the most efficient way.
It was the task for us from the presentation that you show us, but this part is missing in the tutorial. I am just curious if you forgot on this part, or it shouldn’t be shown?

Thank you for answer/s
Branislav

Hi! I’m a little late (I just made an account :slight_smile:) and you may (probably) have already figured it out but just incase (or just incase someone else has the same issue) he talks about it in the 5-7min part of the video.

I’ve spoiled out the next parts because it’s mostly what could be found out by watching that part of the video and/or looking at the “Lecture Project Changes” for the video which is the better way to find out.

It’s basically in OnPressedHigher changing “min = guess” to “min = guess + 1” and in OnPressedLower changing “max = guess” to “max = guess - 1”.

This just kind of says "don’t include the guess that was just made in our range. So (for example) if the number we chose is higher than the guess then the lowest guess possible should be that guess plus 1. This disallows any number already guessed to be chosen but in my code and based on some of the topics in some other people’s code can cause it’s own bug if your not careful.

Privacy & Terms