MasterMind in Java
Page
I found
this ray-traced image of a MasterMind board, and I liked it so much
I made this anchor
for it. It points to the Lambda Systems
Ltd. Web site, in their "image/" subdirectory. (Their site
also has the Java source code.)
Actually, I wrote my first MasterMind program back in the 1970s when I was at Xerox. I was working in the CAD/CAM department, and we had a network of PDP-11s linking sites around the county. My part of this was that I wrote MCR language ... I cloned the command input "batch" language for the RSX-11M operating system and added inter- process communication commands that allowed the Master Operator to dynamicly (interactively :-) reconfigure the network.
Anywho, I wrote the MasterMind program in this language as a kind of benchmark for performance. Since it was an interpreted language that used an ASCII text file as input, handling of "subroutines" became a performance consideration. My MasterMind program *solved* puzzles, and never took more than six guesses, although I was never able to *prove* that six was the worst possible outcome for the algorithm.
Well, now I "collect" MasterMind programs because of my interest in how others have tackled the computer-human interface. My first implementation was for a LA-36 dot-matrix printer/terminal, and since the language and user interface were based on the BASIC/TTY paradigm, it was fairly "user-friendly".
My hands down favorite so far is Doug Bickers' version. Watch out for Stephen Schultz's version ... it leaves indestructable dialog windows lying around after each activation of the applet! :-(