Bulls and Cows, known also as Cows and Bulls or Pigs and Bulls is an old code-breaking paper and pencil game for two players, similar to Mastermind.
It is a game with numbers that may date back a century or more. It is played by two opponents. The game can also be played with 3 digits instead of 4.
On a sheet of paper, the players each write a 4-digit secret number. The digits must be all different. Then, in turn, the players try to guess their opponents number who gives the number of matches. If the matching digits are on their right positions, they are "bulls", if on different positions, they are "cows". Example:
Secret number: 4271
Opponents try: 1234
Answer: 1 bull and 2 cows. (The bull is "2", the cows are "4" and "1".)