10 PRINT TAB(33);"WAR"
20 PRINT TAB(15);"CREATIVE COMPUTING  MORRISTOWN, NEW JERSEY"
30 PRINT: PRINT: PRINT
100 PRINT "THIS IS THE CARD GAME OF WAR.  EACH CARD IS GIVEN BY SUIT-#"
110 PRINT "AS S-7 FOR SPADE 7.  ";
120 PRINT "DO YOU WANT DIRECTIONS";
130 INPUT B$
140 IF B$="NO" THEN 210
150 IF B$="YES" THEN 180
160 PRINT "YES OR NO, PLEASE.  ";
170 GOTO 120
180 PRINT "THE COMPUTER GIVES YOU AND IT A 'CARD'.  THE HIGHER CARD"
190 PRINT "(NUMERICALLY) WINS.  THE GAME ENDS WHEN YOU CHOOSE NOT TO"
200 PRINT "CONTINUE OR WHEN YOU HAVE FINISHED THE PACK."
210 PRINT
220 PRINT
230 DIM A$(52),L(54)
240 FOR I=1 TO 52
250 READ A$(I)
260 NEXT I
270 REM
280 FOR J=1 TO 52
290 LET L(J)=INT(52*RND(1))+1
295 IF J=1 THEN 350
300 FOR K=1 TO J-1
310 IF L(K)<>L(J) THEN 340
320 REM
330 GOTO 290
340 NEXT K
350 NEXT J
360 P=P+1
370 M1=L(P)
380 P=P+1
390 M2=L(P)
400 PRINT
420 PRINT "YOU: ";A$(M1),"COMPUTER: ";A$(M2)
430 N1=INT((M1-.5)/4)
440 N2=INT((M2-.5)/4)
450 IF N1>=N2 THEN 490
460 A1=A1+1
470 PRINT "THE COMPUTER WINS!!! YOU HAVE";B1;"AND THE COMPUTER HAS";A1
480 GOTO 540
490 IF N1=N2 THEN 530
500 B1=B1+1
510 PRINT "YOU WIN. YOU HAVE";B1;"AND THE COMPUTER HAS";A1
520 GOTO 540
530 PRINT "TIE.  NO SC OR E CHANGE."
540 IF L(P+1)=0 THEN 610
550 PRINT "DO YOU WANT TO CONTINUE";
560 INPUT V$
570 IF V$="YES" THEN 360
580 IF V$="NO" THEN 650
590 PRINT "YES OR NO, PLEASE.  ";
600 GOTO 540
610 PRINT
620 PRINT
630 PRINT "WE HAVE RUN OUT OF CARDS.  FINAL SC OR E:  YOU: ";B1;
640 PRINT "  THE COMPUTER: ";A1:PRINT
650 PRINT "THANKS FOR PLAYING.  IT WAS FUN."
655 PRINT
660 DATA "S-2","H-2","C-2","D-2","S-3","H-3","C-3","D-3"
670 DATA "S-4","H-4","C-4","D-4","S-5","H-5","C-5","D-5"
680 DATA "S-6","H-6","C-6","D-6","S-7","H-7","C-7","D-7"
690 DATA "S-8","H-8","C-8","D-8","S-9","H-9","C-9","D-9"
700 DATA "S-10","H-10","C-10","D-10","S-J","H-J","C-J","D-J"
710 DATA "S-Q","H-Q","C-Q","D-Q","S-K","H-K","C-K","D-K"
720 DATA "S-A","H-A","C-A","D-A"
999 END
