PCjs Machines

Home of the original IBM PC emulator for browsers.

Logo

Challenger 1P BASIC Programs

TANKFORTWO.BAS

OSI Challenger 1P

Challenger 1P
Speed:
Stopped

Listing

[From OSIweb]

 10 PRINT:PRINT:PRINT"TANK FOR TWO":PRINT
 20 PRINT"COPYRIGHT R. OLSEN 1978
 30 T1=3:T2=7:POKE530,1::S(1)=54429:S(2)=54403
 40 FORX=1TO8:READTA(X):NEXT:P1=53916:P2=54019
 50 FORX=0TO9:READMF(X):NEXT
 60 FORX=0TO9:READBD(X):NEXT:L=64
 70 C1=53279:C2=55265:P0=128:PT=4:FORX=1TO5:READUP(X):NEXT
 80 FORX=1TO7:READAC(X):NEXT
 90 VB=600:IFPEEK(57088)<128THENVB=540:GOTO150
 100 FORX=0TO9:READMF(X):NEXT:L=32
 110 P0=127:PT=251:S(1)=53765:S(2)=53785:FORX=1TO5
 120 READUP(X):NEXT
 130 FORX=1TO7:READAC(X):NEXT:P1=53766:P2=53592
 140 C1=53284:C2=54204
 150 INPUT"DO YOU WANT DIRECTION";A$:IFA$="YES"THEN610 
 160 FORX=C1TOC2:POKEX,32:IFRND(1)>.96THENPOKEX,161
 170 NEXT
 180 POKE56900,0:POKE530,1:B=161:KB=57088
 190 FORX=1TO5:FORY=1TO5:POKEUP(Y)+X,B:NEXTY:NEXTX
 200 FORX=1TO5:FORY=1TO7:POKEAC(Y)+L*X,B:NEXTY,X
 210 FORX=1TOL:POKEC1+X,B:POKEC2-X,B:NEXT
 220 FORX=1TO32:POKEC1+X*L,B:POKEC2-X*L,B:NEXT
 230 POKEKB,P0:PK=PEEK(KB):IFVB=600THENPK=255-PK
 240 IFPK=128THENT2=T2-1:IFT2=0THENT2=8
 250 M1=MF(T1):M3=MF(T2)
 260 IFPK=32THENT2=T2+1:IFT2=9THENT2=1
 270 IFPK=64ANDF2=0THENB2=P2:F2=1:M4=MF(T2)
 280 IFPK=160ANDPEEK(P2+MF(T2))=32THENPOKEP2,32:P2=P2+MF(T2)
 290 IFPK=192ANDF2=0THENB2=P2-MF(T2-1):F2=1
 300 IFPK=96ANDF2=0THENB2=P2-MF(T2+1):F2=1
 310 POKEP2,TA(T2)
 320 POKEKB,PT:PK=PEEK(KB):IFVB=600THENPK=255-PK
 330 IFPK=8THENT1=T1-1:IFT1=0THENT1=8
 340 IFPK=10ANDPEEK(P1+MF(T1))=32THENPOKEP1,32:P1=P1+MF(T1)
 350 IFPK=2THENT1=T1+1:IFT1=9THENT1=1
 360 IFPK=4ANDF1=0THENF1=1:B1=P1:SM=MF(T2)
 370 IFPK=6ANDF1=0THENB1=P1-MF(T1+1):F1=1
 380 IFPK=12ANDF1=0THENB1=P1-MF(T1-1):F1=1
 390 POKEP1,TA(T1)
 400 FORX=1TO3:IFF1=0THEN460
 410 IFB1<>P1THENPOKEB1,32
 420 P=PEEK(B1+M1):IFP=161THENF1=0:GOTO460
 430 B1=B1+M1:POKEB1,BD(T1)
 440 IFP=TA(T2)THENF1=0:B1=P1:S1=S1+1:GOTO460
 450 IFB1<C1ORB1>C2THENF1=0
 460 IFF2=0THEN520
 470 IFB2<>P2THENPOKEPB2,32
 480 P=PEEK(B2+M3):IFP=161THENF2=0:GOTO520
 490 B2=B2+M3:POKEB2,BD(T2)
 500 IFP=TA(T1)THENF2=0:B2=P2:S2=S2+1
 510 IFB2<C1ORB2>C2THENF2=0
 520 IFB2<>P2THENPOKEB2,32
 530 IFB1<>P1THENPOKEB1,32
 540 NEXTX
 550 DS=S2:IFS2>10THENDS=S2-10:POKES(2)-1,49
 560 POKES(2),DS+48:IFDS=10THENPOKES(2),48
 570 DS=S1:IFS1>10THENDS=S1-10:POKES(1)-1,49
 580 POKES(1),DS+48:IFDS=10THENPOKES(1),48
 590 IFS1>19ORS2>19THEN810  
 600 GOTO230
 610 PRINT:PRINT:PRINT:PRINT"PLAYER 1 USES KEYS 1,2, AND 3
 620 PRINT"PLAYER 2 USES KEYS N,M, AND<
 630 PRINT"1,2,N, AND< ARE DIRECTION KEYS
 640 PRINT"PRESSING BOTH DIRECTION KEYS MOVES YOU FORWARD
 650 PRINT:PRINT"KEYS 2 AND M ARE FIRE CONTROL KEYS
 660 PRINT"PRESSING THEM ALONE FIRES STRAIGHT AHEAD
 670 PRINT"PRESSING THEM WITH A DIRECTION KEY SHOOTS
 680 PRINT"TO THE SIDE
 690 PRINT"THE MISSLE IS STEERABLE AFTER IT IS SHOT
 700 INPUT"INPUT A NUMBER TO START";X:GOTO160
 710 DATA248,249,250,251,252,253,254,255
 720 DATA -65,-64,-63,1,65,64,63,-1,-65,-64,-63
 730 DATA139,189,132,190,139,189,132,190,139
 740 DATA53633,53526,54618,54411,54793
 750 DATA53216,53233,53848,53702,54411,54939,54406
 760 DATA-33,-32,-31,1,33,32,31,-1,-33,-32
 770 DATA53845,53965,53956,53609,53845,53968,54006
 780 DATA53641,53359,53415,53782,54005
 790 FORX=0TO9:READBD(X):NEXT:L=64
 800 RETURN
 810 IFS1>19THENFORX=1TO32:PRINT"TANK 1 WINS!":NEXTX
 820 IFS2>19THENFORX=1TO32:PRINTTAB(15)"TANK 2 WINS!":NEXTX
 830 S1=0:S2=0
 840 RESTORE:GOTO30