Compucolor.org – Virtual Media

Listing of file='ALIEN.BAS;01' on disk='vmedia/swarms-sector.ccvf'

100 REM CAPTURE THE ALIEN
110 REM BASED ON TSC'S 6800 MACHINE LANGUAGE GAME
120 REM BY WILLIAM L. GREENE, JR.
130 PLOT 6,3
140 PLOT 6,36,12,6,25,14,3,20,8,27,24
150 PRINT "  CAPTURE THE ALIEN  "
160 PLOT 3,80,0
170 PLOT 6,2:CLEAR
180 DIM Q(11,11):FOR X= 0TO 11:FOR Y= 0TO 11:Q(Y,X)= 0
190 Q(0,X)= - 1:Q(11,X)= - 1:Q(Y,0)= - 1:Q(Y,11)= - 1:NEXT Y:NEXT X
200 A= RND (- PEEK (33209))
210 DEF FN R(R)= INT (R* RND (1))
220 PLOT 12,15:S= FN R(26):IF S< 20THEN 220
230 PLOT 3,12,4,6,6:PRINT "YOU HAVE";S;" SHOTS."
240 PLOT 3,55,1,6,2:PRINT "SECTOR"
250 FOR Y= 6TO 24STEP 2:FOR X= 4TO 40STEP 4
260 PLOT 3,X,Y,6,3:PRINT CHR$ (96):NEXT X:NEXT Y
270 FOR N= 1TO 10:PLOT 3,42,N* 2+ 4,6,2:PRINT N
280 PLOT 3,N* 4- 1,26:PRINT N:NEXT N
290 X= FN R(10)+ 1:Y= FN R(10)+ 1
300 PLOT 3,23,3,6,6
310 PRINT "ALIEN'S LAST KNOWN POSITION : ";X;",";Y;" "
320 PLOT 2,6,25:PLOT 242,84,25,84,105,6,105,6,25,255
330 PLOT 3,4* X,2* Y+ 4,6,65:PRINT CHR$ (42)
340 IF S= 0THEN 810
350 C= X:D= Y
360 A= FN R(10)+ 1:IF A< CTHEN X= X- 1
370 IF A> CTHEN X= X+ 1
380 IF X< 1THEN X= 1
390 A= FN R(10)+ 1:IF A< DTHEN Y= Y- 1
400 IF A> DTHEN Y= Y+ 1
410 IF Y< 1THEN Y= 1
420 IF Q(Y,X)< > - 1THEN 440
430 X= C:Y= D:GOTO 360
440 A= FN R(100)+ 1:IF A> 5THEN 500
450 PLOT 3,4,28,6,6:PRINT "THE SHIP HAS BEEN ATTACKED."
460 PLOT 3,4,29:PRINT "PHASOR ENERGY USED TO REPLENISH SHIELDS."
470 S= S- 1:PLOT 3,7,4:PRINT "YOU HAVE";S;" SHOTS REMAINING. "
480 IF S= 1THEN PLOT 3,7,4:PRINT "YOU HAVE ONE SHOT LEFT.     "
490 IF S< = 0THEN 810
500 A= FN R(100)+ 1:IF A< 94THEN 550
510 A= FN R(10)+ 1:B= FN R(10)+ 1:IF A= XAND B= YTHEN 510
520 Q(B,A)= - 1
530 PLOT 3,4* A,2* B+ 4:PRINT SPC( 1)
540 PLOT 3,40,2,6,2:PRINT "SUPERNOVA IN : ";A;",";B;" "
550 PLOT 3,45,5:PRINT SPC( 20)
560 PLOT 3,45,5,6,2:INPUT "YOUR SHOT : ";A$,B$:A= VAL (A$):B= VAL (B$)
570 IF A< 1OR A> 10OR A< > INT (A)THEN 870
580 IF B< 1OR B> 10OR B< > INT (B)THEN 870
590 S= S- 1:PLOT 3,4* C,2* D+ 4,6,3:PRINT CHR$ (96)
600 PLOT 3,4* A,2* B+ 4:PRINT SPC( 1)
610 PLOT 3,7,4,6,6:PRINT "YOU HAVE";S;" SHOTS REMAINING."
620 PLOT 3,0,2,11:PLOT 3,0,28,11:PLOT 3,0,29,11
630 IF S= 1THEN PLOT 3,7,4:PRINT "YOU HAVE ONE SHOT LEFT.     "
640 IF A= XAND B= YTHEN 830
650 IF Q(B,A)= - 1THEN 850
660 Q(B,A)= - 1
670 FOR A= X- 1TO X+ 1:FOR B= Y- 1TO Y+ 1
680 IF A= XTHEN IF B= YTHEN 710
690 IF A= 0THEN IF B= 0THEN 710
700 IF Q(B,A)< > - 1THEN 300
710 NEXT B:NEXT A
720 PLOT 3,4,0:PRINT "CONGRATULATIONS, COMMANDER, THE ALIEN HAS"
730 PLOT 3,4,1:PRINT "BEEN CAPTURED WITH";S;" SHOTS REMAINING."
740 PLOT 3,4* X,2* Y+ 4,6,65:PRINT CHR$ (42)
750 IF S= 1THEN PLOT 3,29,1:PRINT SPC( 1)
760 PLOT 3,4,31,6,3:INPUT "ANOTHER GAME (Y/N)? ";A$
770 IF LEFT$ (A$,1)= "N"THEN 800
780 IF LEFT$ (A$,1)= "Y"THEN 170
790 GOTO 760
800 PLOT 6,2,12,1
810 PLOT 3,4,0:PRINT "PHASORS OUT OF ENERGY. NO SHOTS LEFT."
820 PLOT 3,4,1:PRINT "THE ALIEN ESCAPED. RETURN TO BASE.";:GOTO 760
830 PLOT 3,4,0:PRINT "YOU JUST FRIED THE ALIEN. MISSION A FAILURE."
840 PLOT 3,4,1:PRINT "RETURN TO BASE. ":GOTO 760
850 PLOT 3,4,29:PRINT "SHOT WASTED. SECTOR";A;",";B;" ALREADY DESTROYED."
860 PLOT 3,45,5:PRINT SPC( 19):PRINT SPC( 1):GOTO 300
870 PLOT 3,4,29,6,65:PRINT "ENTER X, Y; 1 TO 10; USE COMMA.                "
880 PLOT 3,45,5:PRINT SPC( 19):PRINT SPC( 1)
890 GOTO 560