I am thinking of a number between 1 and N. You will make guesses, and I’ll give one of the following replies:
where the ‘distance’ between a and b is defined as abs(a-b).
If you correctly guess my number, I’ll instead answer FOUND and you win the game. However, after 100 guesses I’ll get bored and stop replying, which means you fail the game.
Your goal is to find my number in as few guesses as possible.
Try out some rounds with N=100 in the browser here:
Now N=1,000,000,000 so you’ll need something more heavy-duty.
Here is some stub code to get you started: Python3
Good luck!
name | # queries |
---|
Note: A player’s score is the maximum of their last 5 attempts to avoid lucky guesses. If any of these attempts were failed or left incomplete, the player’s score will be omitted. (Feel free to run 5 games in parallel to speed up this process.)