The classic game where you must determine the four digit secret code, similar to the popular game Mastermind.
Bull and cows is a traditional code breaker game, similar to the popular game Mastermind.
The object is to guess the four digit secret code. The secret code has the following properties:
1. The code contains only the digits 0 through 9.
2. All digits in the code are different (no two digits appear twice).
3. The code does not start with a 0.
To help you break the code, for each guess you will be told how many bulls and cows are present:
A bull tells you that your guess has the correct digit in the correct location.
A cow tells you that your guess has the correct digit, but it is in the wrong location.
An X tells you that none of the digits you entered are in the code.
For example, if the code is 1570, and you guess 1098, you get 1 bull (for the digit 1, which is in the correct place), and 1 cow (for the digit 0, which is in the code, but in the wrong place).
When you have 4 bulls, you win the game.