Guess the Number
The computer picks a secret number — guess it in as few tries as you can.
Pick a range, then guess — you’ll get a higher or lower hint after every try, and press Enter to submit. Halving the remaining range each time finds any number from 1–100 in at most seven guesses.
The computer secretly picks a number within a range you choose, and you try to guess it in as few tries as possible, getting a higher/lower hint after each guess — a simple game that also happens to be a good illustration of binary search.
Track your best score across rounds and see how close to the theoretical minimum number of guesses you can get.
Frequently asked questions
- What's the optimal strategy to guess in the fewest tries?
- Always guess the midpoint of the remaining possible range — this binary-search strategy guarantees finding the number in at most log₂(range) guesses, the fewest possible in the worst case.
- Can I choose a wider or narrower number range?
- Yes — set the range before starting, from a small range for a quick game to a much wider one for a more challenging round.
- Is the secret number actually random each round?
- Yes — a new number is randomly selected within your chosen range at the start of every round.