This is Seven R. Van den Berg's mastermind program that I have modified
for the 48sx.  The program uses the graphics screen in order to display
10 levels at a time...almost all games take 10 or less guesses.  Only
'gues' and 'init' were modified for the graphics display, the rest of the
code remains unmodified.  The original code was written for the 28c, so
size was minimized.  I expanded it some, but speed could be improved with
more modification.
                                Dan Snyder
                                snyderd@jacobs.cs.orst.edu


From: berg@cip-s02.informatik.rwth-aachen.de (SRB)

Have you ever tried to play mastermind on your own?  Here's the solution:

Note: it was written originally for the HP28C (i.e. memory conservative),
therefore the speed of this program can be improved considerably.
But, considering the application, the response time may be well within bounds.

Playing instructions:
----------------------------------
To start up a mastermind session execute 'init' first, then enter your guesses.
To enter a guess, first type a #-sign, then type the colours, then
execute 'gues'.

Every time you execute 'init', a new permutation is made up by your calculator
according to the restrictions in 'col', 'dig', and 'sam'; it is stored in 's'.

If you want to check (or peek at) the correct guess, just execute 's':
disregard the leading F's and you've got the desired guess.

You could even have someone else make up a guess, and put it into 's' manually.
Though, be sure to adjust 'dig' to the desired number of digits.

The correctness of your guess is reported after executing 'gues'.
  Before the point: the no. of colours in correct positions
  After the point:  the no. of colours misaligned

You can adjust 'col', 'dig', and 'sam' to your personal taste, but all the
following conditions have to be met:
1<=col<=16  1<=sam<=15  1<=dig<=16  dig<=col*sam

'col' specifies the maximum number of colours used.
'dig' specifies the number of digits used.
'sam' specifies the maximum number of digits of one same colour.

The colours are defined as: 0 1 2 3 4 5 6 7 8 9 A B C D E F

