August 12, 2012

Bulls and Cows

Bulls and Cows is a two player game. First player thinks of a N digit secret number and second player guesses that number. This is done by second player making a guess and first player telling the number of bulls and cows in the guess. If the digits of guess matches secret and they are in right position, it's a bull, if they match but on different position, they are cows. For e.g. Let secret be 0123 and guess be 0012. The guess has 1 bull, 2 cows. The game continues, until second player gets a response of N bulls.

The problem is to write a computer solver for bulls and cows that would try to guess the secret making only a small number of attempts.

Solution: show


  1. Thanks on creating one of the most stylish blogs I have come across in a long time! It's truly incredible how much you are able to take away from some thing simply because of how aesthetically gorgeous it is. Youve created a fantastic be site fantastic graphics , structure. site!

  2. I just came to your blog searching for Machine Learning I came across a post on SVM of your better half and came to get to this blog. What a wonderful writing sir. Impressed. Thanks. Best Wishes.