Number Guess

Tries: 0En Az Tries: -

I have picked a number between 1 and 50!

Category
Brain
Players
1
Controls
Keyboard
Strategy
Halve the range
Loads
No download

Controls

Type a numberEnter your guess.
Read the clueToo high or too low narrows the range.
New numberStart again with a fresh target.
Next up

More games

About this game

Number Guess hides a number and tells you only whether each guess was too high or too low. Narrow it down and find it in as few attempts as possible. It is the simplest guessing game there is, and it happens to be a perfect demonstration of one of computing's most important ideas.

That idea is binary search. If you always guess the middle of the remaining range, you halve the possibilities with every attempt, which means even a range of a thousand numbers falls in about ten guesses. Most people discover this strategy for themselves after a few rounds, which is exactly what makes the game a good teacher.

Tips & strategy

Always guess the middle of what is left. If you know the number is between one and fifty, guess twenty-five. Whatever the answer, you have eliminated half the possibilities in a single move, which no other guess can match.

Keep track of both bounds, not just the last clue. After a few guesses the range is squeezed from both ends, and players who only remember the most recent hint end up re-testing numbers they already ruled out.

Do not guess at random once the range is small. With four numbers left, the middle guess still beats a hopeful stab, because it guarantees you finish in two more turns rather than possibly four.

Notice how few guesses it actually takes. Halving repeatedly is astonishingly powerful: a range of a thousand needs only about ten guesses, and seeing that for yourself is the real lesson here.

Questions

What clues do I get?

Only whether your guess was higher or lower than the hidden number.

What is the best strategy?

Guess the middle of the remaining range every time. This is called binary search and it is provably the fastest method.

How many guesses should it take?

For a range of fifty, about six with good play. Each guess should halve what is left.

Is this educational?

Yes. It is the classic hands-on introduction to binary search, a foundational idea in computer science.

Is there anything to install?

Completely free, with no trial and no unlock. Number Guess loads with the page and plays immediately, without an install step or a video ad first.