Classic Computer Magazine Archive ANTIC VOL. 7, NO. 11 / MARCH 1989

Type-In Software

GAME OF THE MONTH

Baker Solitaire

All the cards are face up, so there's no excuse. By Tom Cline

Baker Solitaire is a computer version of Eight Off, an "open" solo card game. This BASIC program works on 8-bit Atari computers with at least 48K memory, disk or cassette.

Almost everyone has played Klondike, perhaps the most popular of solitaire card games. In Klondike the cards are dealt face down (except for the top card) into seven columns with one card in the first column, two in the second column and so on.

Klondike is an example of a closed solitaire game. A closed game is one in which a decision on the play of a card is made without full knowledge of all the other cards.

Baker is an "open" solitaire game, a version of Eight Off, in which all cards are dealt face up. Since a player has complete information on all the cards, each position of the cards can be analyzed to determine the "best" next move. (Baker appeared in Martin Gardner's column in the June 1968 issue of Scientific American. The game is named after C.L. Baker, who introduced the game to Gardner.)

GETTING STARTED

Type in Listing 1, BAKER.BAS, check it with TYPO II, and SAVE a copy to disk before you RUN it.

If you have trouble typing the special characters in lines 45-50, don't type them in. Instead, type Listing 2, check it with TYPO II and SAVE a copy. When you RUN Listing 2, it creates these hard-to-type lines and stores them in a file called LINES.LST.

To merge the two programs, disk users LOAD "D:BAKER.BAS" and then ENTER "D:LINES.LST." Cassette users: CLOAD Listing 1, then insert the separate cassette used for Listing 2 and ENTER "C:". Remember to SAVE the completed program before you RUN it.

Baker can be played with two, three, or four suits of thirteen cards each. The degree of difficulty increases dramatically with the number of suits.

Each suit is represented by a different color. The card values are indicated by single-digit numbers and letters. A ten is indicated by a capital T.

The cards are dealt face up into columns and rows called the "field." The number of columns of cards in the field depends on the number of suits used. Two suits yield six columns, three suits produce seven columns and all four suits give you eight columns.

The object of the game is to sort all the cards of each suit into a separate pile, called a "terminal pile." The cards must be placed one at a time on this pile, in ascending order, with the Ace on the bottom and the King on top.

Each terminal pile starts on one of the green stars at the upper right of the screen, in an area marked with "T."

In addition to the field and the terminal pile, a card may occupy a "parking space" at the upper left of the screen, in an area marked with a "P." There are as many parking spaces as suits. Each space is marked by a gold star with a letter underneath, and can hold only one card.

RULES OF PLAY

Within the field, an exposed card (a card at the bottom of a column) can be moved onto the next-highest card of the same suit, if it is also exposed.

For example, if a green six is exposed in the first column, and a green seven is exposed in the second column, the six may be placed on the seven.

A card in a parking space may be moved onto the field the same way.

Any exposed card can be moved tol an empty parking space. Each parking space will hold only one card at a time.

Any exposed card, or parked caKi, can be moved onto the terminal pile, so long as it follows the sequence. Once a column is empty, any srposed or parked card can be moved to it.

MOVING CARDS

A card is moved using the keyboard. First, press a letter indicating the column or parking space of the card to be moved. Next, press the letter indicating the card's destination. To move a card from column 'b' to parking space 'k', for example, you'd type BK.

The first letter pressed will turn black to show you which card is being moved. When the second letter is pressed, the card is moved, you'll hear a tone, and the first letter's color will change back to purple.

If an illegal move is attempted, either one of the letters or the purple line will flash on and off for a few seconds. If you decide not to move a card, just press the key that corresponds to the black letter.

TAKE IT BACK!

At any point you can use the space bar to "take back" a move and restore the previous positions of the cards. The program can remember up to 300 moves--enough to go all the way back to the beginning of most games. You may want to use this feature to try a different line of play if you get stuck, or to study possible moves.

Use the letter P to mark a position that you may want to return to. When you go back to that position using the spacebar, a buzzer will sound and the letter P will turn blue. These options can be very useful in studying play strategy.

GROUP MOVEMENTS

While only one card can be moved at a time, there are certain positions of the cards where it would be convenient to move a group of cards. For example, if you're lucky enough to have a green 8, 7, 6 and 5 in the bottom of column b, and a green 9 at the end of column c, and enough open columns or parking spaces to move them all one at a time, you'd type TBC to move the 8,7,6 and 5 from column b to column c, all at once.

If the group transfer cannot legally be made, one of the column letters will blink on and off several times. To stop this command without completing a group move, press T again.

You can save quite a few keystokes by using the letter T when you want to move a group of cards. If you're just learning the game, however, you should move just one card at time until you become more familiar with the game.

To start a new game press the ESC key. Once you've won a game, BAKER will flash the word "WINNER" and tell you how many moves it took you to complete the game. Press any key to play again.

Tom Cline of Berkeley, California is making his debut in Antic.

Listing: BAKER.BAS Download