*** Welcome to piglix ***

Bulls and Cows


Bulls and Cows (also known as Cows and Bulls or Pigs and Bulls or Bulls and Cleots) is an old code-breaking mind or paper and pencil game for two or more players, predating the similar commercially marketed board game Mastermind.

It is a game with numbers or words that may date back a century or more. It is played by two opponents.

The numerical version of the game is usually played with 4 digits, but can also be played with 3 or any other number of digits.

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 opponent's number who gives the number of matches. If the matching digits are in their right positions, they are "bulls", if in different positions, they are "cows". Example:

The first one to reveal the other's secret number wins the game. As the first player has a logical advantage, the game can be balanced over multiple games by alternating the right to go first, or over a single game by granting the second player an equal number of guesses, possibly resulting in a tie.

The game may also be played by two teams of 2–3 players, with the team members discussing their strategy before selecting a move.

A computer program moo, written in 1970 by J. M. Grochow at MIT in the PL/I computer language for the Multics operating system, was amongst the first Bulls and Cows computer implementations, inspired by a similar program written by Frank King in 1968 and running on the Cambridge University mainframe. Because the game has simple rules, while it is difficult and entertaining, there are many computer variants; it is often included in telephones and PDAs.

It is proven that any number could be solved within seven turns. Minimal average game length is 26274/5040=5.2131 turns.

This version is usually played orally, but is easier to play if each player (or each team) keeps written notes. It is exactly like the numerical version except instead of 4-digit numbers, 4-letter words are used. They must be real words, according to whatever language or languages you are playing the game in. Alternate versions of the game can be played with 3-letter or 5-letter words, but the 4-letter version is the most popular. Several versions of this game are available for Computer & Mobile devices. The first official massively multiplayer (MMO) version of this game was first made available for Android devices under the name WORD - Multiplayer Word Game. The Game play for letter version of this game is as follows.


...
Wikipedia

...