This is a code golf challenge to see the shortest implementation of an automated guesser in the pen and paper game bulls and cows.
The game works as follows:
A (usually 4 digit) secret code with only distinct integers 0-9 is picked by one player. A second player guesses codes that each receive a rank. This rank contains 1 bull for every digit that is correctly placed in the guess, and 1 cow for every digit in the guess that is in the secret code, but not in the correct location within the code.
The code should assume a format as follows:
The combination will be a 4 digit number containing only distinct digits 0-9. (eg. 0123 is valid, 0112 is not)
After each guess, you will be given a string as a response telling you how many bulls and how many cows are in your answer. It will be formatted as xByC, in which x is the number of bulls and y is the number of cows. (i.e. 4B0C means you have won). You can assume that a made-up method called "rateGuess", which takes your guess as a string will provide the response.