****************************************************** NAME:CHECKERS TYPE:BASIC FORMAT:ASCII SA/LA:0000 0000 ****************************************************** 10 REM========================== 12 REM 14 REM C H E C K E R S 16 REM 18 REM BY: TODD BURNS 20 REM 249 N. TWP. RD. 87 22 REM FOSTORIA, OHIO 44830 24 REM 419-435-8805 26 REM 28 REM WRITTEN JANUARY 1983 30 REM FOR 16K MEMORY-EXT BASIC 32 REM 34 REM========================== 36 REM PUT HEADER ON SCREEN... 38 CLS:PRINT@138,"TODD BURNS":PRINT@171,"PRESENTS:" 40 PRINT@232,"CHECKERS BUILT":PRINT@267,"FOR TWO!" 42 REM THIS SECTION PLAYS MUSIC FOR INTRODUCTION... 44 F$="T6O3L2.CO2AFCL4DEFL2DL4FL1..CL2.GO3CO2AFL4DEFL2GL4AL1.G" 46 S$="L4AB-AGO3L2CO2L4AGL1FL4GL2AL4FL2DL4FDL1CL4CL2FL4AL2GL4CL2FL4AG" 48 T$="L4AB-O3CO2AFL2GL4CL1F" 50 PLAY F$:PLAY S$:PLAY T$ 52 REM DISPLAY INSTRUCTIONS USING INSTRUCTION SUBROUTINE... 54 CLS:GOSUB 270 56 REM INITIALIZATION SECTION.. 58 PCLEAR 4:PMODE 3,1:PCLS 1:DIM K(12,2),A$(8):FOR I=1 TO 12:K(I,1)=0:K(I,2)=0:NEXT I:S=0 60 REM DRAW ODD ROWS ON CHECKER BOARD... 62 LINE(24,24)-(48,0),PSET,BF:LINE(72,24)-(96,0),PSET,BF:LINE(120,24)-(144,0),PSET,BF:LINE(168,24)-(192,0),PSET,BF 64 LINE(24,72)-(48,48),PSET,BF:LINE(72,72)-(96,48),PSET,BF:LINE(120,72)-(144,48),PSET,BF:LINE(168,72)-(192,48),PSET,BF 66 LINE(24,120)-(48,96),PSET,BF:LINE(72,120)-(96,96),PSET,BF:LINE(120,120)-(144,96),PSET,BF:LINE(168,120)-(192,96),PSET,BF 68 LINE(24,168)-(48,144),PSET,BF:LINE(72,168)-(96,144),PSET,BF:LINE(120,168)-(144,144),PSET,BF:LINE(168,168)-(192,144),PSET,BF 70 REM DRAW EVEN ROWS ON CHECKER BOARD... 72 LINE(0,48)-(24,24),PSET,BF:LINE(48,48)-(72,24),PSET,BF:LINE(96,48)-(120,24),PSET,BF:LINE(144,48)-(168,24),PSET,BF 74 LINE(0,96)-(24,72),PSET,BF:LINE(48,96)-(72,72),PSET,BF:LINE(96,96)-(120,72),PSET,BF:LINE(144,96)-(168,72),PSET,BF 76 LINE(0,144)-(24,120),PSET,BF:LINE(48,144)-(72,120),PSET,BF:LINE(96,144)-(120,120),PSET,BF:LINE(144,144)-(168,120),PSET,BF 78 LINE(0,192)-(24,168),PSET,BF:LINE(48,192)-(72,168),PSET,BF:LINE(96,192)-(120,168),PSET,BF:LINE(144,192)-(168,168),PSET,BF 80 REM DRAW OUTSIDE BOARDER ON CHECKER BOARD... 82 LINE(0,0)-(192,0),PSET:LINE -(192,192),PSET:LINE -(0,192),PSET:LINE -(0,0),PSET 84 REM DRAW CHECKERS ON BOARD.. 86 FOR I=36 TO 192 STEP 48 88 CIRCLE(I,12),8,3:PAINT(I,12),3,3 90 CIRCLE(I,60),8,3:PAINT(I,60),3,3 92 CIRCLE(I,156),8,2:PAINT(I,156),2,2 94 NEXT I 96 FOR I=12 TO 192 STEP 48 98 CIRCLE(I,36),8,3:PAINT(I,36),3,3 100 CIRCLE(I,132),8,2:PAINT(I,132),2,2 102 CIRCLE(I,180),8,2:PAINT(I,180),2,2 104 NEXT I 106 PRINT:PRINT:PRINT" -- PRESS SPACEBAR TO START! --"; 108 IF INKEY$<>" "THEN 108 110 REM THE FOLLOWING IS THE MAIN SECTION OF THE PROGRAM.. 112 SCREEN 1,0:N=1:S=0:SA=0 114 IF SA<>N THEN GOSUB 226:SA=N 116 FL=0:GOSUB 158:IF PPOINT(H,V+2)=4 OR PPOINT(H,V+2)=1 OR NP=1 THEN 116 118 CC=PPOINT(H,V+2):X=H:Y=V:IF N/2=INT(N/2) THEN CP=3::ELSE CP=2 120 IF CC=CP THEN 114::ELSE SOUND 130,3 122 GOSUB 158:IF NP=1 THEN N=N+1:NP=0:GOTO114 124 IF PPOINT(H,V+2)<>4 THEN 122 126 GOSUB 196 128 IF (N/2<>INT(N/2) AND VY AND KI=0) THEN SOUND150,3:SOUND150,3:SOUND150,3:IF FL=0 THEN 114 :ELSE 122 130 IF ABS(X-H)=24 AND ABS(Y-V)=24 AND FL=0 THEN 134 132 IF ABS(X-H)=48 AND ABS(Y-V)=48 THEN 140::ELSE SOUND 150,3:SOUND150,3:SOUND150,3:IF FL=0 THEN 114 :ELSE 122 134 SOUND 140,3:N=N+1:PAINT(X,Y),4,1:CIRCLE(H,V),8,CC:PAINT(H,V),CC,CC 136 IF KI=1 OR NK=1 THEN GOSUB 212 138 GOTO 114 140 IF H>X THEN H1=-24 :ELSE H1=24 142 IF V>Y THEN V1=-24 :ELSE V1=24 144 IF PPOINT(H+H1,V+V1+2)<>CP AND FL=0 THEN SOUND 150,3:SOUND150,3:SOUND150,3:GOTO114::ELSE IF PPOINT(H+H1,V+V1+2)<>CP THEN 122 146 SOUND 140,3:FL=1:PAINT(X,Y),4,1:CIRCLE(H,V),8,CC:PAINT(H,V),CC,CC:PAINT(H+H1,V+V1),4,1 148 IF KI=1 OR NK=1 THEN GOSUB 212 150 DU=0:FOR I=1 TO 12:IF K(I,1)=H1+H AND K(I,2)=V1+V THEN K(I,1)=0:K(I,2)=0:S=S-1:DU=I 152 NEXT I 154 IF DU<>0 AND DU<>12 THEN FOR I=DU TO 11:K(I,1)=K(I+1,1):K(I,2)=K(I+1,2):NEXT I 156 FL=1:X=H:Y=V:GOTO 122 158 REM JOYSTICK SECTION... 160 NP=0:IF N/2=INT(N/2) THEN S1=2:S2=3::ELSE S1=0:S2=1 162 XX=JOYSTK(0):H=INT(JOYSTK(S1)*3/24)*24+12:V=INT(JOYSTK(S2)*3/24)*24+12:IF H=0 THEN H=1 164 IF INKEY$="D" OR INKEY$="d" THEN NP=1:RETURN 166 IF INKEY$="Q" OR INKEY$="q" THEN 250 168 IF N/2<>INT(N/2) AND (PEEK(65280)=254 OR PEEK(65280)=126) THEN RETURN 170 IF N/2=INT(N/2) AND (PEEK(65280)=125 OR PEEK(65280)=253) THEN RETURN 172 C1=PPOINT(H,V):C2=PPOINT(H+1,V):C3=PPOINT(H-1,V):C4=PPOINT(H,V+1):C5=PPOINT(H-1,V+1):C6=PPOINT(H+1,V+1) 174 IF C1=0 OR C1=3 OR C1=4 THEN D1=1 :ELSE D1=4 176 IF INKEY$="D" OR INKEY$="d" THEN NP=1:RETURN 178 IF C3=0 OR C3=3 OR C3=4 THEN D3=1 :ELSE D3=4 180 IF C2=0 OR C2=3 OR C2=4 THEN D2=1 :ELSE D2=4 182 IF C4=0 OR C4=3 OR C4=4 THEN D4=1 :ELSE D4=4 184 IF C5=0 OR C5=3 OR C5=4 THEN D5=1 :ELSE D5=4 186 IF C6=0 OR C6=3 OR C6=4 THEN D6=1 :ELSE D6=4 188 IF INKEY$="Q" OR INKEY$="q" THEN 250 190 IF INKEY$="D" OR INKEY$="d" THEN NP=1:RETURN 192 PSET(H,V,D1):PSET(H+1,V,D2):PSET(H-1,V,D3):PSET(H,V+1,D4):PSET(H-1,V+1,D5):PSET(H+1,V+1,D6) 194 PSET(H,V,C1):PSET(H+1,V,C2):PSET(H-1,V,C3):PSET(H,V+1,C4):PSET(H-1,V+1,C5):PSET(H+1,V+1,C6):GOTO 162 196 REM THIS SECTION CHECKS TO SEE IF CHECKER SHOULD BE KINGED. 198 NK=0 200 IF N/2=INT(N/2) AND V=12 AND PPOINT(X,Y+2)=2 THEN NK=1 202 IF N/2<>INT(N/2) AND V=180 AND PPOINT(X,Y+2)=3 THEN NK=1 204 REM CKECK TO SEE IF A KING... 206 KI=0 208 IF S=0 THEN RETURN::ELSE FOR I=1 TO S:IF K(I,1)=X AND K(I,2)=Y THEN KI=1:NK=0 210 NEXT I:RETURN 212 REM THIS SECTION CHANGES A CHIP TO A KING... 214 IF NK=1 THEN S=S+1:K(S,1)=H:K(S,2)=V:GOTO 220 216 FOR I=1 TO 12:IF K(I,1)=X AND K(I,2)=Y THEN K(I,1)=H:K(I,2)=V 218 NEXT I 220 K$="U8BR8G4L4BR4F4BR4" 222 DRAW"S2C"+STR$(CP)+"BM"+STR$(H-2)+","+STR$(V+2)+K$ 224 RETURN 226 REM THIS SECTION PRINTS PLAYERS TURN... 228 A$(1)="U8R8D4L8BD4BR12":A$(2)="U8BD8R8BR4":A$(3)="U8R8D4L8BR8D4BR4":A$(4)="BU8F4E4BG4D4BR8":A$(5)="U8R8BD4L8BD4R8BR4":A$(6)="U8R8D4L8BR4F4BR4" 230 A$(7)="BR12" 232 IF N/2<>INT(N/2) THEN A$(8)="BR2R4BL2U8G2E2D8BR4" :ELSE A$(8)="NR8U4R8U4NL6BD8BR4" 234 IF N/2<>INT(N/2) THEN DRAW"S10C1BM223,185NR8U4R8U4NL6BD8BR4" :ELSE DRAW "S10C1BM223,185BR2R4BL2U8G2E2D8BR4" 236 NC=0 238 FOR W=17 TO 185 STEP 24 240 IF N/2=INT(N/2) THEN U$="2" :ELSE U$="3" 242 NC=NC+1:DRAW "S10C"+U$+"BM223,"+STR$(W)+A$(NC) 244 NEXT W 246 SOUND 170,5:SOUND 180,5 248 RETURN 250 REM END OF GAME ROUTINE 252 CLS:PRINT@134,"T H E W I N N E R":PRINT@206,"I S:" 254 T$="T4O2L1GL4AL2A#L2G":U$=T$+"O3L1D" 256 PLAY T$+"P4":PLAY U$ 258 P1=0:P2=0:FOR I=12 TO 184 STEP 24:FOR J=12 TO 184 STEP 24 260 IF PPOINT(J,I+2)=3 THEN P1=P1+1 :ELSE IF PPOINT(J,I+2)=2 THEN P2=P2+1 262 NEXTJ:NEXTI:IF P1>P2 THEN A$="P L A Y E R 1!" :ELSE IF P1" "THEN 280 282 CLS:PRINT 284 PRINT"AT A TIME. AFTER YOU ARE DONE DOING A SINGLE, DOUBLE, ETC. JUMPS, PUSH 'D' TO END TURN." 286 PRINT "TO QUIT THIS GAME PUSH 'Q' AND THE COMPUTER WILL DETERMINE THE WINNER. ALSO IF YOU SELECT A CHECKER AND THEN WISH TO START YOUR MOVE OVER, MAKE AN INVALID MOVE AND YOU WILL BE ABLE TO DO" 288 PRINT"SO. WHEN THE PROGRAM TERMINATESTHE 'OK' PROMPT WILL APPEAR." 290 PRINT " GOOD LUCK!!!" 292 RETURN