Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-01 - 43,50110/war.gam
There are 2 other files named war.gam in the archive. Click here to see a list.
100'  NAME--WAR
110'
120'  DESCRIPTION--PLAYS THE CARD GAME OF WAR.
130'
140'  SOURCE--UNKNOWN
150'
160'  INSTRUCTIONS--TYPE "RUN" AND FOLLOW INSTRUCTIONS, A TIE
170'  MAKES NO SCORE AT ALL.
180'
190'
200'  *  *  *  *  *  *   MAIN PROGRAM   *  *  *  *  *  *  *  *  *  *  *  *
210'
220 PRINT "THIS IS THE CARD GAME OF WAR.  EACH CARD IS GIVEN BY SUIT-#";
230 PRINT "AS S-7 FOR SPADE 7.  ";
240 PRINT "DO YOU WANT DIRECTIONS";
250 INPUT B$
260 IF B$="NO" THEN 330
270 IF B$="YES" THEN 300
280 PRINT "YES OR NO, PLEASE.  ";
290 GO TO 240
300 PRINT "THE 625 GIVES YOU AND IT A 'CARD'.  THE HIGHER 'CARD' ";
310 PRINT "(NUMERICALLY) WINS.  THE GAME ENDS WHEN YOU CHOOSE NOT";
320 PRINT " TO CONTINUE OR WHEN YOU HAVE FINISHED THE PACK."
330 PRINT
340 PRINT
350 DIM A$(52), L(54)
360 FOR I=1 TO 52
370 READ A$(I)
380 NEXT I
390 RANDOM
400 FOR J=1 TO 52
410 LET L(J)=INT(52*RND+1)
420 FOR K=1 TO J-1
430 IF L(K)<>L(J) THEN 460
440 LET J=J-1
450 GO TO 470
460 NEXT K
470 NEXT J
480 LET P=P+1
490 LET M1=L(P)
500 LET P=P+1
510 LET M2=L(P)
520 PRINT
530 PRINT
540 PRINT "YOU: ";A$(M1), "625: ";A$(M2),
550 LET N1=INT((M1-.5)/4)
560 LET N2=INT((M2-.5)/4)
570 IF N1>=N2 THEN 610
580 LET A1=A1+1
590 PRINT "625 WINS.  YOU HAVE";B1;"; 625 HAS";A1
600 GO TO 660
610 IF N1=N2 THEN 650
620 LET B1=B1+1
630 PRINT "YOU WIN.   YOU HAVE";B1;"; 625 HAS";A1
640 GO TO 660
650 PRINT "TIE.  NO SCORE CHANGE."
660 IF L(P+1)=0 THEN 730
670 PRINT "DO YOU WANT TO CONTINUE";
680 INPUT V$
690 IF V$="YES" THEN 480
700 IF V$="NO" THEN 770
710 PRINT "YES OR NO, PLEASE.  ";
720 GO TO 660
730 PRINT
740 PRINT
750 PRINT "YOU HAVE RUN OUT OF CARDS.  FINAL SCORE:  YOU--";B1;
760 PRINT "; 625--";A1
770 PRINT "THANKS FOR PLAYING.  IT WAS FUN."
780 DATA S-2,H-2,C-2,D-2,S-3,H-3,C-3,D-3,S-4,H-4,C-4,D-4,S-5,H-5,C-5
790 DATA D-5,S-6,H-6,C-6,D-6,S-7,H-7,C-7,D-7,S-8,H-8,C-8,D-8,S-9,H-9
800 DATA C-9,D-9,S-10,H-10,C-10,D-10,S-J,H-J,C-J,D-J,S-Q,H-Q,C-Q,D-Q
810 DATA S-K,H-K,C-K,D-K,S-A,H-A,C-A,D-A
820 END