PCjs Machines

Home of the original IBM PC emulator for browsers.

Logo

Challenger 1P BASIC Programs

STARWARS.BAS

OSI Challenger 1P

Challenger 1P
Speed:
Stopped

Listing

 1 REM***ROBERT L.
 2 REM***COPPED
 3 GOSUB20000:FORX=1TO8:READJ(X):NEXTX
 4 H=54000:T=32:U=32
 5 FORX=1TO8:READH(X):NEXT:DIMF(16)
 6 FORX=1TO6:READG(X):NEXT
 7 POKE530,1:KEY=57088:V=32:W=32
 8 DEFFND(X)=X-53349-32*INT((X-53349)/32)
 9 FORX=1TO8:READF(X):NEXT
 10 INPUT"ENTER RANDOM #";Z1
 11 FORX=1TO35:PRINT:NEXT:FORX=1TO100
 12 Y=INT(53349+RND(Z1)*1024)
 13 POKEY,46:NEXT:POKE54117,32
 14 EP=INT(53349+RND(Z1)*919)
 15 IFFND(EP)=<1ORFND(EP)>=24THEN14
 16 R=PEEK(EP)
 17 IFEP>54268OREP<53449THEN14
 50 M=INT(16*RND(Z1)+1)
 52 IFM>15.8THEN2000
 53 IFM>8THEN70
 55 IFFND(EP+F(M))=1ORFND(EP+F(M))=>24THEN50
 57 IFEP+F(M)<53449OREP+F(M)>54268THEN50
 58 EP=EP+F(M)
 60 S=PEEK(EP):POKEEP,4:POKEEP-F(M),R
 62 R=S
 63 IFR=40ORR=41THENR=32
 70 POKEKEY,64:P=PEEK(KEY):FORX=1TO6
 71 IFP=246THENX=5:GOTO1000
 72 IFP=G(X)THENGOTO1000
 73 IFX=ETHENGOTO1000
 74 NEXT
 80 GOTO50
 1000 IFX=<4THEN1010
 1005 ONX-4GOTO1050,1100
 1010 IFFND(H+F(X)-1)=0ORFND(H+F(X)+1)=>24THEN1400
 1015 IFH+F(X)>54268ORH+F(X)<53349THEN1400
 1020 H=H+F(X):I=H+1:J=H-1
 1030 T=PEEK(I):U=PEEK(J)
 1035 IFT=4THENT=32
 1036 IFU=4THENU=32
 1040 POKEI-F(X),V:POKEJ-F(X),W
 1045 POKEJ,40:POKEI,41
 1046 V=T:W=U
 1047 E=X:GOTO1400
 1050 E=0:X=6:GOTO74
 1100 FORX1=1TO150:POKEH,X1:NEXTX1:POKEH,32
 1101 IFH=EPTHEN1200
 1110 GOTO74
 1200 KI=KI+1:IFKI>7THEN3000
 1201 FORC1=1TO22:POKE54117+C1,ASC(MID$(A$,C1,1))
 1202 NEXTC1:FORC2=1TO300:NEXTC2
 1203 FORC1=1TO22:POKE54117+C1,32
 1204 NEXTC1
 1205 GOTO14
 1400 GOTO74
 2000 REM***ALIEN FIRE
 2001 REM***PHASE
 2010 D=INT(1+8*RND(Z1))
 2011 K=FND(EP)
 2015 FORB=1TO24:POKEEP+B*F(D),H(D)
 2017 IFK+B*J(D)=1ORK+B*J(D)>=23THEN2050
 2018 IFEP+B*F(D)<53349OREP+B*F(D)>54268THEN2050
 2020 NEXTB
 2050 FORC=1TOB:POKEEP+C*F(D),32:NEXT
 2060 IFD=2THEN2500
 2070 GOTO70
 2500 FORC1=1TO150
 2501 B6=INT(53349+RND(Z1)*919)
 2502 POKEB6,42:NEXTC1
 2503 PRINT"ENEMY HAS SHATTERED"
 2504 PRINT"TURRET SYSTEM."
 2505 PRINT"TURRET KNOCKED OUT"
 2506 PRINTKI;" RAIDERS BEFORE"
 2507 PRINT"IT WAS DISABLED"
 2508 PRINT"WOULD YOU LIKE TO"
 2509 PRINT"SWITCH TO ANOTHER"
 2510 INPUT"TURRET";B$
 2550 IFLEFT$(B$,1)="Y"THEN2560
 2555 GOTO4000
 2560 FORX4=54117TO54300:POKEX4,32:NEXTX4
 2561 KI=0
 2565 GOTO10
 2600 END
 3000 PRINT"THE TURRET DEFENSE HAS"
 3001 PRINT"SHATTERED THE"
 3002 PRINT"RAIDERS NOW-ABORTED"
 3003 PRINT"ATTEMPT AT STELLAR"
 3004 PRINT"CONQUEST. WOULD YOU"
 3005 PRINT"LIKE THEM TO TRY IT"
 3006 INPUT"AGAIN";B$
 3007 IFLEFT$(B$,1)="Y"THEN2560
 4000 PRINT"OK, THEN THEY'LL GO"
 4001 PRINT"HOME FOR NOW."
 4500 END
 9999 DATA0,0,-1,1,1,-1,1,-1
 10000 DATA140,140,131,131,189,190,190,189
 10005 DATA126,190,222,238,246,250
 10009 DATA-32,32,-1,1,-31,-33,33,31
 20000 A$="NEW TARGET APPROACHING"
 20002 PRINT:PRINT:PRINT:PRINT:PRINT:PRINT
 20010 INPUT"INSTRUCTIONS NEEDED";R$
 20020 IFLEFT$(R$,1)="N"THENRETURN
 20025 PRINT"Destroy the enemy"
 20030 PRINT"by getting it within"
 20035 PRINT"the crosshairs. To"
 20040 PRINT"move the crosshairs,"
 20045 PRINT"type in a:"
 20050 PRINT:PRINT"1> moves up"
 20055 PRINT"2> moves down"
 20060 PRINT"3> moves left"
 20065 PRINT"4> moves right"
 20070 PRINT"5> stops"
 20075 PRINT"6> fires"
 20080 PRINT:PRINT:PRINT"Watch it, though,"
 20085 PRINT"the sucker fires back!!"
 20090 RETURN