Hide & Crack Play now

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.

Play nowGet the iPhone app

The rules

  1. Each player secretly picks a 4-digit code. All four digits are different. Any digit from 0 to 9 may be used.
  2. Each round, both players write a guess: a 4-digit code with all different digits.
  3. The opponent scores each guess against their secret code and hands the score back.
  4. 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.

GuessWhyScore
12341 and 4 are in the code, neither in that slot0/2
5678Only 7 is in the code, and not in that slot0/1
90560 is in the right slot, no other guessed digit is in the code1/0
7041Every digit is in the right slot4/0

Tips for cracking the code

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:

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

Play Hide & Crack freeGet the iPhone app