TAMS / Java / Hades / applets (print version): contents | previous | next
"Mastermind" game solverDescriptionThis PIC16F84-based gadget implements a solver for the
'mastermind' game with four places and seven colors.
(I don't know how the game is called outside of Germany).
It demonstrates the Hades simulation model(s) for the PIC16F84,
including power-down mode,
and the use of the 'smart' multiplexed seven-segment displays.
How to play:
Both the design idea and the original software are by Wolfgang Strobl of GMD.
The original homepage for the documentation
(as 2005.08.09) is
Please visit the above page for the original documentation
and program source code.
The file also include an user guide and the full hardware component
listing, in case you want to build the device.
Note that you should use a fast computer and Java virtual machine
to get acceptable interactive response times for the seven-segment
If available, you should load the "smart-mastermind-mux.hds" design,
which uses the cycle-based simulation variant of the Hades PIC core
and provides the best simulation performance.
Run the applet | Run the editor (via Webstart)
- Think of any four digit number, where each digit runs from 1 to 7.
We will try the number 6714 in this example.
- After the design has been loaded, click the 'Start/Count'
switch once to close the switch whichs wakes the microcontroller up
from its power-down mode.
Click the switch again to open the switch.
- Wait until the microcontroller has calculated its first guess
(6773) for your numbers.
Depending on the speed of your computer,
this can take a while - less than a second on my Athlon.
- Check whether and how many digits in the computers guess are
- Press the 'Start/Count' button twice to increment the number
of correct digits at the right position.
As the count starts at zero, we have to press the 'Start/Count'
switch six times (0-on, 0-off, 1-on, 1-off, 2-on, 2-off).
- Activate and release the 'Enter' switch to tell the computer
about the correct digits.
- Now activate/release the 'Start/Count' switch for any digits
that are in your number, but at a differnent position.
In our example, there are none, so we skip over this step.
- Activate and release the 'Enter' switch.
The microcontroller will now check your input and calculates
its next guess.
- Repeat the process with step 4 until the computer has got
the right result. It might also complain about illegal
and inconsistent input (display 0.0.0.0).
- Once the computer is sure that it has the right result, it
will display a walking pattern on the display decimal point LEDs.
Impressum | 24.11.06