2 REM PRINT TAB(30);"ONE CHECK"
4 REM PRINT TAB(15);"CREATIVE COMPUTING  MORRISTOWN, NEW JERSEY"
6 REM PRINT: PRINT: PRINT
10 PRINT "SOLITAIRE CHECKER PUZZLE BY DAVID AHL"
15 PRINT
20 PRINT "48 CHECKERS ARE PLACED ON THE 2 OUTSIDE SPACES OF A"
25 PRINT "STANDARD 64-SQUARE CHECKERBOARD.  THE OBJECT IS TO"
30 PRINT "REMOVE AS MANY CHECKERS AS POSSIBLE BY DIAGONAL JUMPS"
35 PRINT "(AS IN STANDARD CHECKERS).  USE THE NUMBERED BOARD TO"
40 PRINT "INDICATE THE SQUARE YOU WISH TO JUMP FROM AND TO.  ON"
45 PRINT "THE BOARD PRINTED OUT ON EACH TURN '1' INDICATES A"
50 PRINT "CHECKER AND '0' AN EMPTY SQUARE.  WHEN YOU HAVE NO"
55 PRINT "POSSIBLE JUMPS REMAINING, INPUT A '0' IN RESPONSE TO"
60 PRINT "QUESTION 'JUMP FROM ?'"
62 PRINT
63 PRINT "HERE IS THE NUMERICAL BOARD:"
66 PRINT
70 FOR J=1 TO 57 STEP 8
71 PUSH   J : GOSUB 700 : PRINT J;"   ";   : PUSH J+1 : GOSUB 700 : PRINT J+1;"   ";
72 PUSH J+2 : GOSUB 700 : PRINT J+2;"   "; : PUSH J+3 : GOSUB 700 : PRINT J+3;"   ";
73 PUSH J+4 : GOSUB 700 : PRINT J+4;"   "; : PUSH J+5 : GOSUB 700 : PRINT J+5;"   ";
74 PUSH J+6 : GOSUB 700 : PRINT J+6;"   "; : PUSH J+7 : GOSUB 700 : PRINT J+7
76 NEXT J
77 PRINT
78 PRINT "AND HERE IS THE OPENING POSITION OF THE CHECKERS."
79 PRINT
80 FOR J=1 TO 64
82 @(J)=1
84 NEXT J
86 FOR J=19 TO 43 STEP 8
88 FOR I=J TO J+3
90 @(I)=0
92 NEXT I
94 NEXT J
96 M=0
98 GOTO 340
100 INPUT "JUMP FROM ";F
105 IF F=0 THEN GOTO 500
110 INPUT "TO ";T
112 PRINT
118 REM *** CHECK LEGALITY OF MOVE
120 B=((F-1)/8)
130 C=F-8*B
140 D=((T-1)/8)
150 E=T-8*D
160 IF B>7 THEN GOTO 230
170 IF D>7 THEN GOTO 230
180 IF C>8 THEN GOTO 230
190 IF E>8 THEN GOTO 230
200 IF ABS(B-D)#2 THEN GOTO 230
210 IF ABS(C-E)#2 THEN GOTO 230
212 IF @((T+F)/2)=0 THEN GOTO 230
215 IF @(F)=0 THEN GOTO 230
220 IF @(T)=1 THEN GOTO 230
225 GOTO 250
230 PRINT "ILLEGAL MOVE. TRY AGAIN..."
240 GOTO 100
245 REM *** UPDATE BOARD
250 @(T)=1
260 @(F)=0
270 @((T+F)/2)=0
290 M=M+1
310 REM *** PRINT BOARD
340 FOR J=1 TO 57 STEP 8
350 FOR I=J TO J+7
360 PRINT @(I);
370 NEXT I
380 PRINT
390 NEXT J
400 PRINT
410 GOTO 100
490 REM *** END GAME SUMMARY
500 S=0
510 FOR I=1 TO 64
520 S=S+@(I)
530 NEXT I
540 PRINT:PRINT "YOU MADE ";M;" JUMPS AND HAD ";S;" PIECES"
550 PRINT "REMAINING ON THE BOARD."
560 PRINT
562 INPUT "TRY AGAIN (yes=1, no=0)? "; a
570 IF A=1 THEN GOTO 70
575 IF A=0 THEN GOTO 600
580 PRINT "PLEASE ANSWER '0' OR '1'."
590 GOTO 562
600 PRINT
610 PRINT "O.K.  HOPE YOU HAD FUN!!"
620 END
700 IF POP()<10 THEN PRINT "0";
710 RETURN
