Newsgroups: comp.ai.games
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!gatech!bloom-beacon.mit.edu!news.kei.com!wang!news
From: bruck@actcom.co.il (Uri Bruck)
Subject: Re: Remember Mastermind?
Organization: ACTCOM - Internet Services in Israel
Date: Sat, 6 May 1995 14:29:29 GMT
Message-ID: <D85ux5.1I0@actcom.co.il>
References: <3o8hbg$nu8@hpavla.lf.hp.com> <creedy-0405951121400001@clreedy-mac.mitre.org>
Sender: news@wang.com
Lines: 41

Chris Reedy (creedy@mitre.org) wrote:
: In article <3o8hbg$nu8@hpavla.lf.hp.com>, gary@lf.hp.com (Gary Jackoway) wrote:

: > Anyone have any references for optimal strategies for Mastermind?
: > 
: >[description deleted]
: >
: > My son and I have been playing recently, and I built a little
: > program.  The heuristic I use seems pretty good, and I've never
: > seen it take more than five guesses (although twice it had
: > two choices left on guess five and lucked out).
: > 
: > Is there an optimal algorithm?

: > John Chandler <jpc@a.cs.okstate.edu> wrote:
: > >Some work on the theory of Mastermind was done fifteen or twenty 
: > >years ago by the eminent computer scientist Donald E. Knuth,
: > 
: > As I mentioned in email to Hwa, an optimal strategy for Mastermind was
: > published a year or two ago in the Journal of Recreational Mathematics.
: > I could dig up the reference if necessary.  Some older references that
: > I happen to have handy are:
: > 
: > 1. D.E.Knuth, The Computer as Mastermind, J. Recreational Math. 9 (1976-77),
: >    1-6.
: > 
: > 2. R.W.Irving, Towards an optimum Mastermind strategy, J. Recreational Math.
: >    11 (1978-79), 81-87.
: > 
: > 3. E.Newirth, Some strategies for Mastermind, Zeitschrift fur Operations
: >    Research 26 (1982), 257-278.
: > 
: > 4. V. Chvatal, Mastermind, Combinatorica 3 (1983), 325-329.

I remember reading those JRM articles and if memory serves their optimal
algorithm assures a win  six moves for the game of MasterMind you describe
(4 pegs, six possible colors) so your algorithm is probably
pretty good already. These resrources are the best I found so far
as well. I think they mainly use a language like LISP or PROLOG.
Uri Bruck

