Bulls and Cows: logic against blind luck

Bulls and Cows is the oldest school of logical deduction. The computer picks four distinct digits, and each guess returns not "right/wrong" but a precise hint: how many digits are in place (bulls) and how many are present but misplaced (cows).

Gameplay screenshot: Bulls and Cows

Why it is addictive

The game teaches pruning. One guess with two bulls and one cow instantly deletes thousands of options. Your brain stops thinking "maybe it is 3197" and starts thinking "which combinations are even consistent with the answer". That is the same skill you need for debugging code and analysing data.

Demo solver

The built-in "Demo" does not guess — it enumerates all 5040 possible numbers and at each step keeps only those that would have produced the same answer it got. In a few moves the set collapses to the single secret. At most nine moves.

Where to start

Press "Demo" to watch the machine narrow the search methodically. Then play yourself: start with a guess that has many different digits, and watch how bulls and cows shrink the field. The more carefully you keep the table, the fewer moves it takes to win.

INFO
[Partner ads]

We use cook​ies for analytics. Click "OK" to consent.

Details