Number Guess is a simple but addictive guessing game that tests your logical deduction skills. The game picks a random number between 1 and 100, and you have unlimited attempts to guess it. After each guess, the game tells you whether the target is higher or lower than your guess, using a "hot" or "cold" indicator that gets warmer as you approach the correct number. This feedback system allows you to use binary search logic to narrow down the range efficiently. An optimal strategy using binary search can find any number in at most 7 guesses (since log2(100) ≈ 6.6). The game tracks your guess count and compares it to the theoretical minimum, giving you a score based on how close you came to optimal play.
The game's history display shows all your previous guesses, color-coded: red for "too high," blue for "too low," and green for the correct answer. This visual history helps you avoid repeating guesses and track your deduction process. The game also records your best score (fewest guesses) across sessions using localStorage. The number range was deliberately set to 1-100 because it provides enough complexity to be challenging while remaining solvable within a reasonable number of guesses. A random number generator using Math.random seeded with cryptographic noise ensures that the sequence is unpredictable across games. The interface is DOM-based for simplicity and speed, with no Canvas overhead, making it the fastest-loading game on the site.
Controls
Click/Tapto interact
Designed for both desktop and mobile play. Touch-friendly interface.
Strategy Guide
Number Guess is a binary search training tool disguised as a game. The optimal strategy is always to guess the midpoint of the remaining range. Starting with 50 (out of 1-100) eliminates half the possibilities. Each subsequent guess should split the remaining range. Following this strategy, any number from 1-100 is found in at most 7 guesses. The game tracks your average guess count and subtly ranks your approach efficiency. The hard mode (1-1000) requires at most 10 guesses with optimal play — any more suggests you are guessing randomly rather than halving the range. The game's hint system shows whether your guess is above or below the target, and also shows "warm" or "cold" based on proximity (within 10 = warm, within 5 = hot). The streak counter positively reinforces consistent strategy use. Players who learn binary search consistently clear in 5-6 guesses regardless of the hidden number.
Play Tips
The binary search method is optimal, but there are refinements. When the hint says "cold" (far away), your guess was in the wrong half, so halving is still efficient. When the hint says "warm" (within 10), switch to linear scan within that 10-number range — halving is too slow for a small range. When the hint says "hot" (within 5), you are 1-2 guesses from finding the number. The game's 7-guess limit means a perfect binary search player wins every time, but the game also tracks accuracy. Trying to solve in 5 guesses rather than 7 risks failure but improves your tracked average.
Technical Note
Technical note: the optimal strategy tracking compares the player's guess sequence against the theoretical optimal (binary search, which averages 6.09 guesses for range 1-100). The "warm/cold" hint system calculates distance in absolute terms (warm = within 10, hot = within 5) and updates the hint color dynamically. Pregame seed uses window.crypto.getRandomValues() for non-deterministic number selection each round.