Guess a number between 1 and 100
Guess a number between 1-100, I will tell you if it's too high or too low!
The computer picks a secret number between 1 and 100. Your job: find it using as few guesses as possible.
Every guess cuts the possibilities in half. That's Binary Search -- the same algorithm that powers database indexes, spell checkers, and even COVID testing strategies.
For 1-100: 7 guesses or fewer -- guaranteed.
Finding the number 73 in action:
This is the same algorithm used by databases, search engines, and medical testing. Read the full deep-dive →
Binary Search: always guess the middle of the remaining range. This guarantees finding any number from 1—00 in ≤ guesses.
With perfect play: 4 guesses (1-10), 6 (1-50), 7 (1-100), 10 (1-1000). A lucky first guess wins in 1 —but that's pure chance.
"Too High" means your guess is above the secret number. "Too Low" means it's below. Each hint eliminates half the remaining possibilities.
It teaches binary search —a fundamental computer science algorithm. You practice logical reasoning, estimation, and systematic problem-solving.