Back to index

## Minehunt game for the HP-42S

By Erik Ehrling (Sweden). Any comments or suggestions are very welcome!

This is a HP-42S version of the Minehunt game from the HP48 Equation Library card for the HP-48SX (which is also built-in to the HP-48G/GX).

Usage:

The goal is simple - try to reach the exit square in the lower-right corner without hitting any of the hidden mines. There are 16 mines hidden at random places in the grid. To your guidance, you are informed about the number of mines next to your current position. From that, and with some thinking, it is usually possible to figure out where the mines are and to avoid them. However, there are some situations where you can't know for sure and have to guess.

If you manage to reach the exit square, then go for the harder goal, try to visit every square except for the ones where the mines are. (Note that, like in a patience, the game is not always possible to solve completely.)

Example:

Setup
This takes around 40 seconds (be patient). Each dot represents the placement of one of the 16 mines.

Play
Move by using the numerical keys (diagonal movement also possible). The digit next to the mine shows the number of mines in adjacent squares. (If you anytime during the game want to give up, press the SIGMA+ key).

Game Over
If you hit a mine, or reach the exit square the game ends and your score is displayed. Also shown is the position of all hidden mines.

Technical notes:
• Minehunt requires the small program called UFL found below.
• The game requires that the calculator be in RECT mode.
• The program builds a 7×14 complex matrix where the real part is the number of mines in adjacent squares, and the imaginary part stands for unvisited (0), visited (1), mine (-1) and exit (-2) square. Illegal movements are easily detected by using the indexed matrix position and the matrix wrap flag (76) and undone by simply restoring the last position.
• Keys are read by GETKEY and action is taken by an XEQ IND of the value. (Flag 25, error flag, is set before this call to suppress calls to any non-defined label).
Binary files for emulators:

State-file for Emu42: mineufl.e42 Raw binary: mine.raw ufl.raw Binary for HP-42X: mineufl.42x

Program listing