Skip to content
UniKit

Guess the number

Play a real guess-the-number game in the browser: the secret comes from a seed (four distinct digits by default), every round answers “nA mB”, and the page tracks the guess history, per-round timing and how many candidates are left until you solve it. A 1-100 higher/lower variant is included.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Guess the number

Type a number and submit: A/B mode answers “nA mB”, higher/lower mode answers “too high / too low”. The secret comes from the seed, so everyone gets the same puzzle.

Game 1 · seed demo
No guesses yet: type 4 digits and press “Submit guess”.
Round 1 / 10 · Time — · Candidates 5040
Rounds used
0 / 10
Rounds left
10
Elapsed
—
Candidates left
5040
Hints used
0

Keyboard: digit keys fill the box, Backspace deletes, Enter submits (click the board first so keystrokes land there).

A/B variant: A counts digits correct in value and place, B counts digits present but misplaced; 10 rounds, 4 distinct digits.

What this tool does

  • Start a round right away: four distinct digits, 10 guesses, “nA mB” feedback on every guess, and a clear win or loss.
  • Race a friend with the same seed: the same seed plus variant and digit count always yields the same secret, so fewer guesses and less time win.
  • Practise A/B reasoning: the status line shows how many candidates are still consistent with every answer, and Hint reveals the secret digit by digit.
  • Switch to the 1-100 higher/lower variant for a warm-up: solve it within 7 guesses.

Example

Input

seed demo · 4 digits · guesses 1234, 5678, 3621

Output

Round 1 1234 → 0A3B (0 right digit and place, 3 right digit wrong place)
Round 2 5678 → 1A0B (1 right digit and place, 0 right digit wrong place)
Round 3 3621 → Hit!
The secret for seed demo is 3621 — everyone using that seed gets the same one

The secret and both feedback lines are the real output for seed demo (computed by guessFeedback), so you can replay them exactly.

Frequently asked questions

Can the secret be reproduced?

Yes. In the four-digit variant the secret is the first digits of an xorshift128 shuffle of 0-9 driven by the seed, and the 1-100 variant draws from the same PRNG: the same seed, variant and digit count always give the same secret. Round N uses the seed with a "-N" suffix, so later rounds are reproducible too.

What do A and B mean?

A counts digits that are correct in both value and position, B counts digits present but misplaced; duplicates are matched one-to-one, which is the standard bulls-and-cows convention.

How is the candidate count computed?

Every distinct-digit permutation of the requested length is enumerated (up to 10P5 = 30240) and the ones inconsistent with the recorded feedback are filtered out. Beyond five digits the pool is too large, so the page says “too many (not enumerated)” instead of inventing a number.

Are the timer and the statistics real?

Yes. The clock runs on performance.now() from the start of the round until the solving guess, and the per-round times in the history are real relative timestamps. Rounds, rounds left, candidates and hint count are all derived from the current board — nothing is uploaded and there is no hidden scoring.

Can I play with the keyboard?

Yes. Click the board first so keystrokes land there, then digit keys fill the box, Backspace deletes and Enter submits. When the focus is inside the text box the box handles the keys itself, so nothing is counted twice.

Keywords:1A2Bguess the number

Related tools