Mastermind hint solver
I stumbled across a very difficult programming challenge.
The challenge is... given a set of clues and results from the game "Mastermind", determine the answer, and whether or not there's many or no possible answers.
For example:
(Toggle Plain Text)
9793 0/1
2384 0/2
6264 0/1
3383 1/0
2795 0/0
0218 1/0
The number 3411 is the only one that satisfies the rules.
An explanation of the challenge, and the rules of Mastermind are here:
http://cemc.math.uwaterloo.ca/ccc/1996/21b-prob.html
Now, it's not a difficult challenge at all if you brute force it. Go through every number from 0000 to 9999 and see which ones satisfy all of the clues.
But... that's a terribly ugly algorithm. Very bad complexity. There must be a way to deduce an answer more logically? Thinking about it sends my brain in wild directions though. Seems very difficult.
Have any ideas?
I stumbled across a very difficult programming challenge.
The challenge is... given a set of clues and results from the game "Mastermind", determine the answer, and whether or not there's many or no possible answers.
For example:
(Toggle Plain Text)
9793 0/1
2384 0/2
6264 0/1
3383 1/0
2795 0/0
0218 1/0
The number 3411 is the only one that satisfies the rules.
An explanation of the challenge, and the rules of Mastermind are here:
http://cemc.math.uwaterloo.ca/ccc/1996/21b-prob.html
Now, it's not a difficult challenge at all if you brute force it. Go through every number from 0000 to 9999 and see which ones satisfy all of the clues.
But... that's a terribly ugly algorithm. Very bad complexity. There must be a way to deduce an answer more logically? Thinking about it sends my brain in wild directions though. Seems very difficult.
Have any ideas?