New cross-platform game: Mastermind RK

Other misc things
Post Reply
Well known member
Posts: 218
Joined: Mon Feb 26, 2018 12:58 pm

New cross-platform game: Mastermind RK

Post by RobertK »

Here is my second little cross-platform game: it is Mastermind, a board game I enjoyed playing as a kid.

Your goal is to break a four-digit colour code in as few moves as possible. As soon as you find out the correct strategy, you should be able to usually win each game after about eight or nine guesses.

Download the game and the source from my Sourceforge site:

For a start, 27 different targets are supported (many more can be done):

Bit-90 (a new ColecoVision sub-target available since this morning)
Casio FP-1100
Casio PV-2000
Galaksija Plus (separate text mode and Hi-Res versions)
H?bler Grafik-MC
Mattel Aquarius
MicroBee 128k Standard / Premium / Premium Plus
Nichibutsu My Vision
Philips P2000
Philips VG5000
Robotron A5105 (BIC)
Robotron KC 85/2-5 and HC 900
Robotron Z 1013
Robotron Z 9001 (KC 85/1, KC 87)
SAM Coup?
Sharp X1
Sinclair ZX80
Sinclair ZX81 (+ colourized Chroma version)
Sony SMC-777 and SMC-70
Tiki-100 (also known as "Kontiki-100")
Toshiba Pasopia 7
Triumph Adler Alphatronic PC
VTech Laser 210 / 310 / VZ 200
VTech Laser 500 / 700

The game of course makes more sense on a colour system, but you can play it on B/W systems as well because the initial letter of the colour name is used to display the game piece.

A few technical notes: the game querys the system's capabilities...

Code: Select all

console_ioctl(IOCTL_GENCON_GET_CAPS, &systemCapabilities);
...and the header line on the title screen is displayed in this priority, depending on what is supported by the platform:

- Bold
- Inverse
- Plain text (with asteriskes).

With bold text, you will notice the already mentioned problem with the letter "m" in the game title on many platforms (the letter w is also affected). But the header line is more of a function test. :)

The same is done for displaying the game pieces, here the following priority is used:

- FG colour + BG colour
- FG colour + Inverse (very rare combination, the Pasopia 7 is the only example I have encountered so far)
- FG colour
- Inverse (disabled on the Sharp X1 and the H?bler/Evert-MC because it would not look good with the off-centered characters)
- Plain text

For the ZX80, it would be nice to have a visible sleep function for displaying the error "x ... x" status (when the player tries to advance and not all pieces are set). Currently I'm doing a busy loop and keep updating the screen, but the result is not the best.

Here are a few screenshots:

Casio PV-2000 (BG + FG colour)

Robotron A5105 BIC (BG + FG colour)

Toshiba Pasopia 7 (FG colour + inverse)

Sharp X1 (FG colour)

Sinclair ZX81 (inverse)

H?bler Grafik-MC (inverse)

Kramer-MC (plain text)

Robotron Z 1013 (plain text)
Post Reply