10 PRINT "BATNUM"
20 PRINT "CREATIVE COMPUTING  MORRISTOWN, NEW JERSEY"
30 PRINT
110 PRINT "THIS PROGRAM IS A 'BATTLE OF NUMBERS' GAME, WHERE THE"
120 PRINT "COMPUTER IS YOUR OPPONENT."
130 PRINT
140 PRINT "THE GAME STARTS WITH AN ASSUMED PILE OF OBJECTS. YOU"
150 PRINT "AND YOUR OPPONENT ALTERNATELY REMOVE OBJECTS FROM THE PILE."
160 PRINT "WINNING IS DEFINED IN ADVANCE AS TAKING THE LAST OBJECT OR"
170 PRINT "NOT. YOU CAN ALSO SPECIFY SOME OTHER BEGINNING CONDITIONS."
180 PRINT "DON'T USE ZERO, HOWEVER, IN PLAYING THE GAME."
190 PRINT "ENTER A NEGATIVE NUMBER FOR NEW PILE SIZE TO STOP PLAYING."
200 PRINT
210 GOTO 330
220 FOR I=1 TO 10
230 PRINT
240 NEXT I
330 INPUT "ENTER PILE SIZE"N
340 IF N<0 GOTO 1080
350 IF N>=1 GOTO 390
360 GOTO 330
390 INPUT "ENTER WIN OPTION - 1 TO TAKE LAST, 2 TO AVOID LAST"M
410 IF M=1 GOTO 430
420 IF M#2 GOTO 390
430 INPUT "ENTER MIN PER TURN"A,"AND MAX"B
450 IF A>B GOTO 430
460 IF A<1 GOTO 430
490 INPUT "ENTER START OPTION - 1 COMPUTER FIRST, 2 YOU FIRST"S
500 PRINT
510 IF S=1 GOTO 530
520 IF S#2 GOTO 490
530 C=A+B
540 IF S=2 GOTO 570
550 GOSUB 600
560 IF W=1 GOTO 220
570 GOSUB 810
580 IF W=1 GOTO 220
590 GOTO 550
600 Q=N
610 IF M=1 GOTO 630
620 Q=Q-1
630 IF M=1 GOTO 680
640 IF N>A GOTO 720
650 W=1
660 PRINT "COMPUTER TAKES",N," AND LOSES."
670 RETURN
680 IF N>B GOTO 720
690 W=1
700 PRINT "COMPUTER TAKES",N," AND WINS."
710 RETURN
720 P=Q-C*(Q/C)
730 IF P>=A GOTO 750
740 P=A
750 IF P<=B GOTO 770
760 P=B
770 N=N-P
780 PRINT "COMPUTER TAKES",P," AND LEAVES",N
790 W=0
800 RETURN
810 PRINT
820 INPUT "YOUR MOVE"P
830 IF P#0 GOTO 880
840 PRINT "I TOLD YOU NOT TO USE ZERO! COMPUTER WINS BY FORFEIT."
850 W=1
860 RETURN
880 IF P>=A GOTO 910
890 IF P=N GOTO 960
900 GOTO 920
910 IF P<=B GOTO 940
920 PRINT "ILLEGAL MOVE, REENTER IT!"
930 GOTO 820
940 N=N-P
950 IF N#0 GOTO 1030
960 IF M=1 GOTO 1000
970 PRINT "TOUGH LUCK, YOU LOSE."
980 W=1
990 RETURN
1000 PRINT "CONGRATULATIONS, YOU WIN."
1010 W=1
1020 RETURN
1030 IF N>=0 GOTO 1060
1040 N=N+P
1050 GOTO 920
1060 W=0
1070 RETURN
1080 END
