“CONTSENTRATION” is a TS1000 adaptation of the famous card memory game. Two players alternate turning over “cards”, looking for a match. When a match is found, the cards are removed and placed in the appropriate player’s “pile”. Finding a match entitles the player to another turn. The player with the most cards in his pile after all cards have been removed, wins.
The “cards” are actually the letters of the alphabet. There are two of each letter, for a total of 52 cards. It is therefore exactly like playing the game with a standard deck of cards, where you match red or black pairs. When you start the program, you are prompted to enter the players’ names (maximum 8 characters). The program then “shuffles” the deck, and lays out the cards in a 4×13 matrix. The players’ names are shown below, and a “>” cursor marks whose turn it is. To turn over a card, enter the row (1-4) followed by the column (A-M). For instance, the card in the top left corner is 1A. If you enter an invalid input, it is rejected and the input prompt reappears. If the spot is empty, the program rubs it in and re-prompts.
Ater turning over the second card, if you have a match the cards are removed and placed next to your name. If no match, you have a few seconds to memorize what is there before the cards are turned over again. When playing with real cards, you can often tell cards that have been moved because they are put back slightly askew; this program simulates this by showing turned cards as inverse “+” instead of inverse “0”. At the end of the game, the winner is indicated.
Believe it or not, this program runs in a 2K TS1000. However, to save space, some of the variables are defined manually. Enter the program lines, then enter the following immediate commands:
LET O=0
LET P=1
LET Q=2
LET R=4
LET S=13
LET L=21
LET M=3
DIM B$(4,13)
DIM N$(2,8)
Start the program with GOTO 100, or GOTO 50 to SAVE to tape. Do not use RUN or CLEAR!
If you have 16K or more, add line 1 GOTO 100, and put the immediate commands into line numbers 100-109. If this is done, it is OK to use RUN to start the program.
In the listing, lower-case letters represent inverse video. For example, line 450 is inverse 0’s separated by normal spaces. Line 700: “@” represents inverse “+”. Subroutine 4 is a “blinkless PAUSE”. Like PAUSE it can be terminated prematurely with a keypress (as after turning the second card, or during an error message). Enjoy the game!
4 FOR A=O TO L*R
5 IF INKEY$<>"" THEN RETURN
6 NEXT A
7 RETURN
21 PRINT AT Q*H(B)+P,Q*I(B)+Q;C$
22 RETURN
50 SAVE "CONTSENTRATIOn"
120 LET T=O
130 PRINT AT R,R+R;"conTSentration",,,,"BY F.NACHBAUR",,,
140 GOSUB R
150 FOR A=P TO Q
160 PRINT "NAME-PLAYER ";A;"?"
170 INPUT N$(A)
180 NEXT A
200 LET A$="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
210 LET A$=A$+A$
220 FAST
230 FOR A=P TO S*S
240 LET B=INT (RND*S*R+P)
250 LET C=INT (RND*S*R+P)
260 LET C$=A$(B)
270 LET A$(B)=A$(C)
280 LET A$(C)=C$
290 NEXT A
310 FOR A=O TO M
320 LET B$(A+P)=A$(A*S+P TO )
330 NEXT A
340 LET A$=" "
400 CLS
410 DIM S(Q)
420 SLOW
430 PRINT TAB M;"col";TAB R;"A B C D E F G H I J K L M ","row"
440 FOR A=P TO R
450 PRINT AT A*Q+P,O;" ";A;" o o o o o o o o o o o o o"
470 NEXT A
480 PRINT AT S,Q;N$(P);AT S+M,Q;N$(Q)
490 DIM H(Q)
500 DIM I(Q)
510 FOR B=P TO Q
520 PRINT AT S+M*T,O;">";AT S+M*NOT T,O;" ";AT L,O;"ROW/COL ";B;"=? "
530 INPUT C$
540 IF LEN C$<>Q THEN GOTO VAL "530"
550 IF C$(P)<"1" OR C$(P)>"4" OR C$(Q)<"A" OR C$(Q)>"M" THEN GOTO VAL "530"
560 LET H(B)=VAL C$(P)
570 LET I(B)=CODE C$(Q)-37
580 LET C$=B$(H(B),I(B))
590 IF C$<>" " THEN GOTO VAL "630"
600 PRINT AT L,O;"spot empty."
610 GOSUB R
620 GOTO VAL "520"
630 IF H(P)=H(Q) AND I(P)=I(Q) THEN GOTO VAL "520"
640 GOSUB L
650 NEXT B
660 PRINT AT L,O;A$
670 IF B$(H(P),I(P))=B$(H(Q),I(Q)) THEN GOTO VAL "760"
680 GOSUB R
690 LET T=NOT T
700 LET C$="@"
710 FOR B=P TO Q
720 GOSUB L
730 NEXT B
740 IF S(P)+S(Q)=S*Q THEN GOTO VAL "820"
750 GOTO VAL "490"
760 LET S(T+P)=S(T+P)+P
770 PRINT AT S+P+M*T,P+S(T+P);CHR$ (CODE C$+128)
780 LET C$=" "
790 FOR B=P TO Q
795 LET B$(H(B),I(B))=" "
800 NEXT B
810 GOTO VAL "710"
820 IF S(P)<>S(Q) THEN PRINT AT L-Q,O;"winner-";N$(P+(S(Q)>S(P)))
850 PRINT AT L,O;" GOTO 100 TO START NEW GAME"
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.