The computer selects a random number between 1 and 9999. Your aim is to guess that number in the least number of steps.
Enter a number between and including 1 and 9999.
The computer verifies the number and displays the result in terms of bulls and cows.
A Bull indicates that the digit in your number and the computer's number are in the correct position.
A Cow indicates that the digit is present in the number, but is not in the right position.
The digits 2 and 7 are present in the both the numbers. 7 is in the exact position. So, it is a bull. 2 is not in the same position... so it is a cow.
3, 8 are in the same position - 2 bulls.
5 is in a different position - 1 cow.
8 is in the same position - 1 bull.
2 is in a different position - 1 cow.
2 (1st position) and 8 - 2 bulls.
2 (3rd position) - 1 cow.
3 bulls and 0 cows.
1 bull and 3 cows.