Google
 

Trailing-Edge - PDP-10 Archives - decus_20tap1_198111 - decus/20-0020/batnum.gam
There are 2 other files named batnum.gam in the archive. Click here to see a list.
100'  NAME--BATNUM
110'
120'  DESCRIPTION--BATTLE OF NUMBERS BETWEEN USER AND COMPUTER
130'
140'  SOURCE--UNKNOWN
150'
160'  INSTRUCTIONS--TYPE "RUN" AND FOLLOW INSTRUCTIONS.
170'
180'
190'  *  *  *  *  *  *   MAIN PROGRAM  *  *  *  *  *  *  *  *  *  *  *
200'
210 PRINT"THIS DEMONSTRATION SHOWS YOU SOME VERSATILE FEATURES OF"
220 PRINT"PDP-10 TIME-SHARING SERVICE. IT IS A 'BATTLE-OF-NUMBERS'"
230 PRINT"GAME, WHERE THE COMPUTER IS YOUR OPPONENT."
240 PRINT
250 PRINT"THE GAME STARTS WITH AN ASSUMED PILE OF OBJECTS.YOU AND"
260 PRINT"YOUR OPPONENT ALTERNATLY REMOVE OBJECTS FROM THE PILE."
270 PRINT"WINNING IS DEFINED IN ADVANCE AS TAKING THE LAST OBJECT"
280 PRINT"OR NOT. YOU CAN ALSO SPECIFY SOME OTHER BEGINNING"
290 PRINT"CONDITIONS. DON'T USE ZERO, HOWEVER, IN PLAYING THE GAME."
300 PRINT
310 PRINT
320 GOTO 440
330 PRINT
340 PRINT
350 PRINT
360 PRINT
370 PRINT
380 PRINT
390 PRINT
400 PRINT
410 PRINT
420 PRINT
430 PRINT
440 PRINT"ENTER PILE SIZE:";
450 INPUT N
460 IF N<>0 THEN 480
470 GOTO 440
480 IF N<>INT(N) THEN 330
490 IF N<1 THEN 330
500 PRINT "ENTER WIN OPTION - 1 TO TAKE LAST, 2 TO AVOID LAST: ";
510 INPUT M
520 IF M=1 THEN 540
530 IF M<>2 THEN 500
540 PRINT "ENTER MIN AND MAX: ";
550 INPUT A,B
560 IF A>B THEN 540
570 IF A<1 THEN 540
580 IF A<>INT(A) THEN 540
590 IF B<>INT(B) THEN 540
600 PRINT"ENTER START OPTION - 1 COMPUTER FIRST, 2 YOU FIRST:";
610 INPUT S
620 IF S=1 THEN 640
630 IF S<>2 THEN 600
640 LET C=A+B
650 IF S=2 THEN 680
660 GOSUB 710
670 IF W=1 THEN 330
680 GOSUB 920
690 IF W=1 THEN 330
700 GO TO 660
710 LET Q=N
720 IF M=1 THEN 740
730 LET Q=Q-1
740 IF M=1 THEN 790
750 IF N>A THEN 830
760 LET W=1
770 PRINT"COMPUTER TAKES";N;"AND LOSES."
780 RETURN
790 IF N>B THEN 830
800 LET W=1
810 PRINT"COMPUTER TAKES";N;"AND WINS."
820 RETURN
830 LET P=Q-C*INT(Q/C)
840 IF P>=A THEN 860
850 LET P=A
860 IF P<=B THEN 880
870 LET P=B
880 LET N=N-P
890 PRINT"COMPUTER TAKES";P;"AND LEAVES";N
900 LET W=0
910 RETURN
920 PRINT "YOUR MOVE: ";
930 INPUT P
940 IF P<>0 THEN 980
950 PRINT"I TOLD YOU NOT TO USE ZERO...COMPUTER WINS BY FORFEIT."
960 LET W=1
970 RETURN
980 IF P<>INT(P) THEN 1030
990 IF P>=A THEN 1020
1000 IF P=N THEN 1070
1010 GO TO 1030
1020 IF P<=B THEN 1050
1030 PRINT "ILLEGAL MOVE, REENTER IT: ";
1040 GO TO 930
1050 LET N=N-P
1060 IF N<>0 THEN 1140
1070 IF M=1 THEN 1110
1080 PRINT"TOUGH LUCK, YOU LOSE."
1090 LET W=1
1100 RETURN
1110 PRINT"CONGRATULATIONS, YOU WIN."
1120 LET W=1
1130 RETURN
1140 IF N>=0 THEN 1170
1150 LET N=N+P
1160 GO TO 1030
1170 LET W=0
1180 RETURN
1190 END