About this tool
Play the traditional guess-the-number game between 1 and 100. The computer picks a secret number and you have to guess it. After each guess, you get a hint ("higher" or "lower"). The goal is to guess in as few attempts as possible. Useful for a quick game, for teaching logical thinking (binary strategy), or for entertaining yourself in short breaks.
How to use
- The computer picks a secret number between 1 and 100.
- Enter a guess.
- You get a hint: the secret number is higher, lower, or equal.
- Continue until you get it right. The number of attempts used appears at the end.
Frequently asked questions
- What's the optimal strategy?
- Binary search: start in the middle (50). Based on the hint, halve the remaining range again. Using this method, you guarantee guessing in at most 7 attempts for a range of 1 to 100. Any strategy that doesn't halve the range is on average worse.
- Is the chosen number really random?
- Yes, it's generated randomly at each new game. There's no fixed pattern or favouritism toward "round" numbers. Every number from 1 to 100 has equal probability of being chosen.
- Can I play with a different range?
- This version is fixed at 1 to 100. For variants (1 to 1000, 1 to 10), look for specific games. The minimum number of attempts grows with the range size (about log2 of the range).