![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Banned
![]() ![]() |
Mastermind Algorithm
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: 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? This is my brute force method: safe.in 4 6 9793 0/1 2384 0/2 6264 0/1 3383 1/0 2795 0/0 0218 1/0 1 1234 4/0 1 1234 2/2 2 6428 3/0 1357 3/0 1996_2.1b.c c Syntax (Toggle Plain Text)
safe.out 3411 1234 indeterminate impossible Last edited by Sane; Dec 8th, 2007 at 3:46 PM. |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
![]() |