Number Guessing Game
Play a number guessing game with higher-or-lower hints.
Guess the number
In this game the computer picks a secret number in a range and you guess it, with each guess told whether the target is higher or lower. This is a simple, satisfying game of narrowing down the answer.
Guess the number using the higher-or-lower hints.
A game that teaches a clever strategy
This game is a lovely, hands-on lesson in an efficient search strategy, because there is a genuinely optimal way to play it. Rather than guessing randomly, the smart move is always to guess the middle of the remaining range, since whichever way the hint points, you eliminate half the possibilities at a stroke. Keep halving the range and you close in on the answer remarkably fast — even a range of a thousand numbers can be cracked in about ten well-chosen guesses. This is a famous and important idea in computing, where this halving approach is one of the most efficient ways to search a sorted list, and the game is a perfect intuitive demonstration of it. Beyond the strategy, it is simply a satisfying game of closing in on a hidden number. Whether you play it for fun or notice the clever halving trick and see how few guesses you can manage, the number guessing game packs a genuinely useful idea into an enjoyable little challenge.
Questions & answers
What is the best strategy?
Always guess the middle of the remaining range — whichever way the hint points, you eliminate half the possibilities, closing in remarkably fast.
Why is that strategy interesting?
The halving approach is one of the most efficient ways to search in computing, and this game is a perfect intuitive demonstration of it.
Is anything uploaded?
No. It runs entirely in your browser.