views:

625

answers:

5

Bulls & Cows is a game for two players in which each one has a secret number with 4 non-repeating digits, and each one tries to guess the other number.

For instance, let´s say my secret number is 1576.

If my opponent says the number 1234, i would answer: 1F, because the digit 1 is in my secret number and in the same position. If my opponent says the number 7890, i would answer: 1P, because the digit 7 is in my secret number and in different position. ETC. Here it is explained.

Well, as a hobby, I wish to implement a computer player that tryes to guess my number, but I don't know where to start,

  • any ideas?
  • Is there something already done on this game?
  • Is out there any C# Implementation?
A: 

Sounds like a MasterMind variant.

JRL
+3  A: 

This is a variant of the game Mastermind. Quite a lot of work has been done on algorithms for guessing solutions. Beyond those shown at the wikipedia link, some googling using "mastermind" as the keyword will probably turn up a lot. (I'm assuming you haven't found much so far because you didn't know that name).

Chad Birch
I didn't know the name of the game, the game I described is called "picas y fijas" in spanish.
Jhonny D. Cano -Leftware-
+1  A: 

It sounds like a variation on the game 'Mastermind' - there are a few resources here and here (.doc), as well as on the Wikipedia page.

Have fun!

Andy Mikula
A: 

You're playing a variation of the board game "Mastermind". See the algorithm section of the wikipedia article:

http://en.wikipedia.org/wiki/Mastermind_(board_game)

David Berger
A: 

This is a linux flavor of the game, I'm pretty sure you can get source for it and port it to C#

http://sourceforge.net/project/showfiles.php?group_id=182681&package_id=211908

have fun..

z3r0 c001
That program allows to generate a number for user guessing, not the other way around, but thanks anyway
Jhonny D. Cano -Leftware-