` COMPUTE! ISSUE 41 / OCTOBER 1983 / PAGE 90`

Mosaic Puzzle

Bruce Jordan

Remember that once-popular sliding-squares game? With only one free space, you tried to move the colored plastic tiles around to get a particular sequence or color pattern. Although it was a challenge, this computer variation of the game can be a mind-boggling test of skill and dexterity. Versions for VIC, 64, Atari, and the TI-99/4A.

"Mosaic Puzzle" is a computer version of those sliding-squares puzzles that used to drive people nuts before the advent of Rubik's Cube. It can run on either an unexpanded or 3K expanded VIC. The object of the game is to arrange the 15 numbered squares (hexadecimal numbers 1-F in this version) into some predetermined order by sliding them around in their frame. The first few moves are easy, but as the game progresses, it gets a lot more complicated. You'll find yourself rearranging everything just to get the last few squares in place.

This version of the game has a timer for up to 23 hours, 59 minutes, 59 seconds, and a chicken switch. It also automatically checks for the winning order and allows you to go back to the puzzle the way you left it or reset it to the beginning arrangement.

When you start the game, you're asked if you wish to set a time limit. If you answer Y for yes, enter the time limit in one line with no spaces or punctuation between the values. For example, for a 1-hour, 23-minute limit, enter 012300.

Next, enter the goal order. This will be the order that you will try to match to win the game. When this is done, the upper half of the screen will clear, and the puzzle will appear. A moment later, the message !GO! will flash on the screen, along with a tone. The controls for moving the squares are as follows:

```@ up
?/ down
= right
: left
```

A game is just underway in the TI version of "Mosaic Puzzle."

"Mosaic Puzzle," VIC version

If you succeed in getting the squares in the goal order, the message YOU WIN! appears on the screen, accompanied by a short tune and the elapsed time. If the time runs out before you are finished, you'll hear an unpleasant sound. If you want to stop the game, press RETURN and the screen will display the elapsed time. You can then restart the game, either as you left it or reset, by hitting RETURN a second time.

Below is a brief description of the program as originally written on the VIC.

Line 1 sets the limit of memory at 7600. This gives a place to store the image of the puzzle.

Lines 2-5 define variables. Note that S, SC, and SS are defined in two consecutive lines. This is done because there are two possible entry points when restarting the game.

Lines 10-66 GET the time limit.

Lines 70-290 GET the goal order and make sure that no number is entered more than once.

Lines 300-365 put the puzzle on the screen, either from the data table or from memory, then print the go message and start the timer.

Lines 360-560 check the timer, move the number squares, and check for the winning order.

Lines 570-710 print the winning or losing message, display the elapsed time, and play the sound effects.

Lines 720-740 save the position of the blank square, then clear the variables and reset the game.

Lines 745-790 are the DATA statements for the puzzle's beginning order and the winning tune.

Commodore 64 Notes

Chris Metcalf, Programming Assistant

The Commodore 64 version of "Mosaic Puzzle" is very much the same as the original VIC version. However, some minor changes have been made. Either the RETURN key or the fire button allows you to pause momentarily before resuming the game, restarting the program, or stopping play entirely. Breaking off and resuming has no effect on the time clock (displayed at the top of the screen along with the time limit).

As an aid to the user, various keys for up, down, right, and left can be selected at the beginning of the game. A joystick can also be used, as long as it is plugged into control port two. The time limit is an option in this version; if no time limit is selected, the screen will display elapsed time and TIME LIMIT:NONE.

"Mosaic Puzzle," 64 version.

Atari Notes

Marc Sugiyama, Programming Assistant

"Mosaic Puzzle" for the Atari is similar to the original VIC version; however, there are some differences. As you select the order for the goal, the letters will move from the puzzle box to the goal box. The game begins once you have selected all of the letters and numbers (do not forget about the space). If you have selected a time limit, the amount of time you have left is displayed at the bottom of the screen. If you did not select a time limit, the elapsed time is displayed.

You move the space (hole) around the puzzle board with a joystick plugged into the first port. Pressing the trigger activates the pause function. The timer is stopped, but the screen is cleared as well. Pressing the trigger again returns you to the game. Pressing Q while you are in the game allows you to quit the program.

"Mosaic Puzzle," Atari version.

TI-99/4A Notes

Rick Rothstein

The TI/99-4A version of "Mosaic Puzzle" requires Extended BASIC. In this version, you have the option of requesting either letters (A-O) or numbers (1-15) within a 4-by-4 frame. When you have entered your choice, the game board with its lettered or numbered blocks appears in a scrambled order. The object of the game is to slide the blocks about, one at a time, to bring them to one of several preselected patterns. Some patterns that you can try to duplicate are given in the table.

Move the lettered or numbered blocks around the game board with a joystick or the keyboard (E, S, D, and X keys). You actually have a choice of moving either the free space (hole) or the labeled blocks. The game is initially set to move the free space, but by pressing I (note the appearance of the left-right arrow symbol in the lower-left corner of the screen), you can move the labeled blocks.

Each move that you make is tallied, and the total number of moves is given at the bottom of the screen. Moves are normally accompanied by a sliding noise (notice the note symbol at the lower-right corner of the screen). If this noise becomes annoying, press N and the noise will cease (the note will also disappear).

At certain times during the game, you may wish to retrace your previous moves. Press - (minus sign) or hit the fire button to step back through each preceding move. With this option, a maximum of 250 moves can be recalled.

Once you've achieved the desired preselected pattern from its scrambled beginnings, you can restore the original game board pattern by pressing FCTN (REDO) and challenge yourself or others to beat your tally.

Other options available to you during the game are:

 Keystroke Description FCTN (BACK) Returns to the letter or number option menu FCTN (BEGIN Starts a new game FCTN (ERASE) Ends the program

Possible Patterns For Puzzle, TI Version

 1 2 3 4 1 5 9 13 7 8 9 10 5 6 7 8 2 6 10 14 6 1 2 11 9 10 11 12 3 7 11 15 5 4 3 12 13 14 15 4 8 12 15 14 13
 Horizontal Vertical Spiral
 1 2 3 4 12 2 1 15 A B C D 12 13 14 5 7 9 10 4 E F G H 11 15 6 11 5 6 8 I J K L 10 9 8 7 14 13 3 M N O