JIGSAW

Display

(HP-41CX, Hewlett Packard 1983 and DM41X, SwissMicros 2020)
 

Overview
The JIGSAW program is the famous 2-dimensional jigsaw game wrapped into a 1-dimensional display. The user can move the pieces Up, Down, Right or Left depending on where the empty space is. The game can be played with a numerical series of “pieces” varying from 1-8 or a more difficult alphanumerical mode in which the “pieces” can either vary from A..S-H-Z, e.g. N-U or D-K as shown in the example below. The aim is to make the least number of moves when ordering a random pattern like:

      ID_::EFK::JGH   into   DEF::GHI::JK_

The program will ask the user to choose the Numerical (N) or the Alphanumerical (A) mode at the beginning. Between the moves the calculator will make a time-out which is defaulted to 4 periods of 10 seconds. Each interval is indicated by displaying flags 1-4. Without a response to the time-out question at data entry, e.g. 60 seconds, the calculator will take 40 seconds as default. The reason for this is that the user can simply press the [U] (ENTER), [D] (LOG), [R] (7) or [L] (STO) key to make a move. The GETKEYX instruction will intercept this until the time-out has passed. If so, the user will then get the option to continue or not. The display will prompt for R/S in that case. When a valid move is requested, the calculator will check if the move is allowed. If not, it will show this with “??” and give beep tone such that the user can try again.
 

Examples




(click above page for 4 more pages)

 

Program Listing
The listing of JIGSAW is given below with 2 XROM functions SEED and RNDM on lines 21, 22 and 35. These can be taken as explicit calls to other programs in memory or to XROM functions in for example the CCD module. If replaced by these XROM functions (as in the RAW and TXT file) the total number of bytes will be 335 instead of 347.

 

Registers, Labels and Flags

 

Downloads
PDF format of program JIGSAW.
RAW/TXT format of program JIGSAW (in zip file).
 

This program is copyright and is supplied without representation or warranty of any kind. The author assumes no responsibility and shall have no liability, consequential or otherwise, of any kind arising from the use of this program material or any part thereof

© 2006-2020 by Auke Hoekstra

 
Don`t copy text!