5 REM   'WAR 3'.  ORIGINAL 8K MODV FOCAL BY MIKE FURMAN
10 REM   TSS/8 BASIC IV VERSION BY M E LYON JR 1972
15 DIM V(3),X(3),P(3),R(3,3)
20 DATA 1,2,2,3,3,1,1,3,3,2,2,1,2,3,3,1,1,2,0
25 PRINT "THIS IS THE BASIC VERSION OF 'WAR3'.  TWO OR THREE MAY PLAY."
30 PRINT "DO YOU NEED INSTRUCTIONS";\INPUT A$\IF A$="YES" THEN 265
35 PRINT \PRINT \PRINT "NO. OF PLAYERS";\INPUT N
40 IF N=2 THEN 50\IF N=3 THEN 55
45 PRINT "ERROR--TWO OR THREE PLAYERS."\PRINT \GOTO 35
50 N1=1\PRINT \PRINT \GOTO 60
55 N1=N\PRINT \PRINT 
60 FOR J=1 TO N1\READ A,B\PRINT "DISTANCE (FT.) ";A;" TO ";B;\INPUT R(A,B)
65 R(B,A)=R(A,B)\NEXT J\PRINT \PRINT 
70 RESTORE \IF N=2 THEN 95
75 FOR J=1 TO N\READ A,B,C,D,E,F
80 IF R(A,B)<R(C,D)+R(E,F) THEN 90
85 PRINT "ERROR--ILLEGAL TRIANGLE.  RE-ENTER RANGES."\RESTORE \GOTO 60
90 NEXT J\PRINT 
95 FOR J=1 TO N\PRINT "MUZZLE VELOCITY (FT./SEC.) OF ";J;\INPUT V(J)
100 NEXT J\PRINT \PRINT \PRINT 
105 FOR J=1 TO N\X(J)=V(J)^2/32\NEXT J
110 FOR A=1 TO N\FOR B=1 TO N
115 IF X(A)>R(A,B) THEN 130
120 PRINT "ERROR--";A;" CANNOT REACH ";B
125 PRINT "WHAT IS THE MUZZLE VELOCITY OF ";A;\INPUT V(A)\GOTO 105
130 NEXT B\NEXT A\N1=N\PRINT \PRINT \PRINT \PRINT \PRINT 
135 PRINT \PRINT \PRINT "ROUND ";T+1\PRINT \FOR M=1 TO N\IF P(M)=12 THEN 260
140 IF N=3 THEN 150\C=1\IF M<>1 THEN 145\C=2
145 PRINT "PLAYER ";M;" SHOOTING AT ";C\GOTO 175
150 PRINT "PLAYER ";M;" SHOOTING AT";\INPUT C
155 IF C=1 THEN 165\IF C=2 THEN 165\IF C=3 THEN 165
160 PRINT "ERROR--PLAYERS DESIGNATED 1, 2, 3."\GOTO 150
165 IF C<>M THEN 170\PRINT "ERROR--CANNOT SHOOT SELF."\GOTO 150
170 IF P(C)<>12 THEN 175\PRINT "ERROR-- ";C;" IS DEFUNCT"\GOTO 150
175 PRINT "FIRING ANGLE";\INPUT A3
180 IF A3<0 THEN 185\IF A3>180 THEN 185\GOTO 190
185 PRINT "ERROR--FIRED INTO GROUND.  ";M;" NOW DEFUNCT."\P(M)=12\GOTO 240
190 IF A3<90 THEN 195\PRINT "ERROR--FIRED WRONG WAY, LOSE SHOT."\GOTO 260
195 Z=SIN(A3*.0349064)*V(M)^2/32
200 X=(R(M,C)/1000*RND(X))-(R(M,C)/1000*RND(X))
205 D=X+Z\D1=R(M,C)*.05
210 IF D<D1 THEN 220\IF ABS(D-R(M,C))<D1 THEN 225
215 IF D<R(M,C) THEN 230\IF D>R(M,C) THEN 235
220 PRINT "  TOO CLOSE - ";M;" IS DEFUNCT."\P(M)=12\GOTO 240
225 PRINT "  A HIT - ";C;" IS DEFUNCT."\P(C)=12\GOTO 240
230 PRINT "  YOU UNDERSHOT BY ";ABS(D-R(M,C));" FEET."\GOTO 260
235 PRINT "  YOU OVERSHOT BY ";ABS(D-R(M,C));" FEET."\GOTO 260
240 N1=N1-1\IF N1>1 THEN 260
245 FOR M1=1 TO N\IF P(M1)=12 THEN 255
250 PRINT \PRINT "GAME OVER.  ";M1;" WINS."\STOP 
255 NEXT M1\STOP 
260 PRINT \PRINT \NEXT M\T=T+1\GOTO 135
265 PRINT \PRINT "THIS IS A WAR GAME.  TWO OR THREE PLAYERS ARE GIVEN"
270 PRINT "(THEORETICAL) CANNONS WITH WHICH THEY ATTEMPT TO SHOOT EACH"
275 PRINT "OTHER.  THE PARAMETERS FOR DISTANCES AND MUZZLE VELOCITIES ARE "
280 PRINT "SET AT THE BEGINING OF THE GAME.  THE SHOTS ARE FIRED BY"
285 PRINT "GIVING A FIRING ANGLE, EXPRESSED IN DEGREES FROM HORIZONTAL"
290 PRINT \PRINT "THE COMPUTER WILL KEEP TRACK OF THE GAME AND REPORT AFTER EACH"
295 PRINT "MOVE.  A 'HIT' IS SCORED BY FIRING A SHOT WITHIN 5% OF THE TOTAL"
300 PRINT "DISTANCE FIRED OVER.  GOOD LUCK"\PRINT \PRINT \GOTO 35\END 
