I wrote a simple Python program that implements the classic solution, and the classic solution applied row-wise to the 2d version. Some things I've found: It takes a non-trivial amount of time to run. It took me a few minutes to run 100 random test cases. As I mentioned in a comment, there is no feasible way to fully extend the classic solution to 2d, as ...


What I'm going to describe is a rather gung-ho strategy which, frankly, shoudn't work, but to my surprise hasn't failed a single time in all of 100,000 trials I performed. It finds the secret pattern after or fewer trials. As pattern space is vast this doesn't rule out that there are worst case patterns defeating the strategy. Strategy The heuristics that ...


We start with usual Mastermind logic: Now the interesting part: Therefore Nice twist on the usual Mastermind logic and should be “gettable” for a solver who is switched on. Great puzzle!

Only top voted, non community-wiki answers of a minimum length are eligible