Mastermind Solver Performance Tester v2.0 by AR Mackwani
This program checks the performance of three Mastermind Solver Programs -
[10] based on RT Rosu's Random Search
[11] based on Frans van Gool's Search
[00] based on my modifications explained below with
[01] being my fast search routine.
Setting Up: Enter the desired number of colors, positions, and runs. Select Display Games to view each game with only a 2 sec time interval; otherwise select Runs=1. The normal mode [00] is my modification of the Random Search algorithm. Select [10] if desired to match Rosu's algorithm (i.e. totally random search) or [11] to match Frans' search routine. Select [01] for my Fast Search for minimum Average Time To Solve (Avg Guesses per Run may increase). Enter a number >1 below for R to set the %age of Possible Combos at which the Fast Search cycle will restart. Note that 15 here equals 1.5%. Click OK. The results are displayed continuously. CANCEL lets you get out. You can restart by clicking the Reload or Refresh button on your browser.
Checking my Fast Search [01] at various R values:
Select Runs>1 (say 100) and No for Display Games. Change the R value and check the Avg/Max Time To Solve to determine the best value of R for faster solution for a given game setup. Note that the time shown does not include the delay for visual display.

My Modifications:
For RT Rosu see http://www.csc.ncsu.edu:8080/academics/undergrad/Reports/rtrosu/heuristic.htm
For Frans van Gool see http://www.xs4all.nl/~griffel/java/algorithm.html

Rosu's program is modified by eliminating a number of arrays, thereby cutting down on memory requirements. With my modifications the search is not totally random but utilizes the results from the previous guesses to come up with the next guess. Also the new possible guess is tested starting from the last to the first guess made as this is closer to the code.

Let R = colors in correct position, W = colors not in correct position, P = no. of Positions, and T = R+W. In my modified routines, the program switches from random searching to a different specific search routine if:
1) T = 0 (usually at start), 2) R = P-1, 3) R = P-2, 4) T = P, 5) T = P-1, or 6) T = P-2 in that order of priority. This speeds up the solution as the average number of combinations checked per code is greatly reduced as can be seen in the statistics run by this program. Also on games where colors>3 and positions>3 and Fast Search is selected, the search is started again from the begining when the code is not cracked after 0.1xR% of the max possible combos for that setting are checked and none of the specific search routines from 2) to 5) above are set. Although this increases the number of guesses required to solve the code, the solving time is greatly reduced.
Please note that the time shown is the actual processing time for the algorithm, i.e it does not include the delay required for visual display.

Frans van Gool's routine is modified to allow the lower digits to continue instead of setting them to zeros after the highest digit that should at least change is found.

Please visit www.geocities.com/rmackwani to play the boardgame and to get your own secret code solved with MM Numeric Solver.
Please send your comments to [email protected].
Last modified: 16 Feb 04

Hosted by www.Geocities.ws

1