The Binary Search Strategy
Are you just guessing?
If you are guessing randomly (e.g., 5, then 99, then 34), you are relying on luck. The mathematically optimal way to play "Guess the Number" is to divide the problem in half with every single guess. This is an algorithm called Binary Search.
The Algorithm
Always guess the midpoint of your remaining possible range.
1. Range is 1-100? Guess 50.
2. "Lower"? Range is 1-49. Guess 25.
3. "Higher"? Range is 26-49. Guess 37.
Why 7 Guesses?
For a range of 100 numbers, the number 7 isn't arbitrary. It's related to powers of 2.
26 = 64
27 = 128
This means in 7 steps, you can uniquely identify any 1 item out of 128 possibilities. For range 1000, you need 10 guesses (210 = 1024).
Using the Heat Map
Our game adds a "Hot/Cold" bar. This gives you analogue information that a simple Binary Search doesn't use. If you are "Very Hot" but "Lower", you know the number is very close (e.g., within 5-10 units), so you might refine your next binary jump to be smaller than usual.