[[wp:Bulls and Cows|Bulls and Cows]] &nbsp; is an old game played with pencil and paper that was later implemented using computers.


;Task:
Create a four digit random number from the digits &nbsp; '''1''' &nbsp; to &nbsp; '''9''', &nbsp; without duplication.

The program should: 
::::::* &nbsp; ask for guesses to this number
::::::* &nbsp; reject guesses that are malformed
::::::* &nbsp; print the score for the guess


The score is computed as:
# The player wins if the guess is the same as the randomly chosen number, and the program ends.
# A score of one '''bull''' is accumulated for each digit in the guess that equals the corresponding digit in the randomly chosen initial number.
# A score of one '''cow''' is accumulated for each digit in the guess that also appears in the randomly chosen number, but in the wrong position.


;Related tasks:
* &nbsp; [[Bulls and cows/Player]]
* &nbsp; [[Guess the number]]
* &nbsp; [[Guess the number/With Feedback]]
* &nbsp; [[Mastermind]]
<br><br>
