>Hi
>
>I like to play a game called "Cows & Bulls" online.
>
>The computer chooses a four-digit number. Numbers
>cannot be repeated, nor can the number start with 0.
>
>The player (me!) inputs a four digit number (containing
>no repeated digit), and is told how many "bulls" (digits
>in the answer, and also in the correct position), and
>how many "cows" (digits in the answer, but in the wrong
>position.
>
>Here is some sample output:
>
>[I am thinking of a 4-digits number]
>1: 1234 : 0 bulls and 2 cows
>2: 5678 : 0 bulls and 0 cows
>3: 3209 : 2 bulls and 2 cows
>4: 3029 : 1 bull and 3 cows
>5: 3902 : 1 bull and 3 cows
>6: 3290 : 0 bulls and 4 cows
>7: 9023 : 0 bulls and 4 cows
>8: 3902 : 1 bull and 3 cows
>9: 2309 : the answer
>[Bravo! Congratulations, you found the answer!]
>
>[] = computer output; rest is my guesses + outcome.
>
>Can anyone suggest a strategy for playing this game to
>complete the puzzle in the least possible number of turns?
>
>(If you want to play, the website is http://5ko.free.fr/en/bk.html
>and I have no connection whatsoever with that website).
The game looks similar to Mastermind. See, for example:
http://mathworld.wolfram.com/Mastermind.html
--Lynn
Google is your fiend.
however it is best to google for "mastermind strategy" since the rules
are well, similar.
I could be wrong. And my employer thinks I am.
HTH
JJ
Pick the decision tree with the least depth.
Are your guesses restricted to the set of possible answers?
Bye.
Jasen
I recall that Knuth published a paper with a decision tree to play an
optimal game of Mastermind several years ago ...
According to the instructions, apparently yes, you must give a
possible answer as a guess (so if your first guess of 1234 gives one
hit, you can't next use 1122 to narrow the choice faster.