How to play Bulls and Cows
Bulls and Cows is a classic code-breaking game, also known as Mastermind with numbers. Hide & Crack is a free online version you can play in your browser or on your phone.
The rules
- Each player secretly picks a 4-digit code. All four digits are different. Any digit from 0 to 9 may be used.
- Each round, both players write a guess: a 4-digit code with all different digits.
- The opponent scores each guess against their secret code and hands the score back.
- The first player whose guess is the opponent’s code wins. If both crack the code in the same round, the game is a draw.
How the score works
A score is written positions/digits. Positions (the bulls) is how many digits are in the correct slot. Digits (the cows) is how many other digits are in the secret code but in the wrong slot. Each digit counts once, and a correct slot is never also counted as a wrong slot. A guess that scores 4/0 is the code.
Worked example
The secret code is 7041.
| Guess | Why | Score |
|---|---|---|
1234 | 1 and 4 are in the code, neither in that slot | 0/2 |
5678 | Only 7 is in the code, and not in that slot | 0/1 |
9056 | 0 is in the right slot, no other guessed digit is in the code | 1/0 |
7041 | Every digit is in the right slot | 4/0 |
Tips for cracking the code
- Open with two guesses that use eight different digits, such as
1234and5678. Add the two scores. That total tells you how many of the code’s digits come from 0 and 9. - A
0/0is valuable: none of those four digits is in the code, so you can drop all of them. - Make each guess a code that could still be right. A guess that contradicts an earlier score cannot win.
- Keep a sheet of guesses and scores. Hide & Crack has notes built in to pin digits and mark the ones you rule out.
For a full walkthrough of a real game, read the Bulls and Cows strategy guide. Stuck on a code? The Bulls and Cows solver shows every code that still fits.
Other names for Bulls and Cows
The same game goes by several names:
- Cows and Bulls or Pigs and Bulls in English.
- Hit & Blow, a common name in Japan. A hit is a bull and a blow is a cow.
- Number Baseball in Korea, scored in strikes and balls and often played with three digits.
- MOO, an early computer version first written at the Cambridge Computer Laboratory before 1970.
Whatever the name, you hide a code, trade guesses and read a score after each one.
Is it the same as Mastermind?
Mastermind is a similar code-breaking game that uses coloured pegs. Bulls and Cows is the older game: people played it with pencil and paper before Mastermind was sold as a board game (Wikipedia). Bulls and Cows uses digits, and every digit in the code is different. The idea is the same: each score tells you how close a guess was.
Ways to play Hide & Crack
- Quick match finds you an opponent within 15 seconds.
- Private game lets you invite a friend with a link or a 4-digit code.
- Solo lets you crack a code on your own and grades you on the number of rounds.