Hot & Cold

I am thinking of a number between 1 and N. You will make guesses, and I’ll give one of the following replies:

  • HELLO if it is your first guess
  • HOTTER if this guess is closer to my number than your previous guess
  • COLDER if this guess is further away from my number than your previous guess
  • SAME if this guess is the same distance away from my number as your previous guess

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:

The challenge

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.)