This is a two-player game where the interprocess communication
mechanism is a pair of shared disc files. Look for the ASSIGN,
ADVANCE, READ #1 and PRINT #1 commands.
At startup, the first player waits for the second player by checking
the appropriate file. To actually perform the wait, a SYSTEM
call is made to execute the PAUSE comamnd.
1000 PRINT '14'24'24'24'15TAB(10)'8'8'8'8'10"TLE"'8'8'8'8'8'8'8'8'8"SKYBATTLE"
1010 S2=0
1020 S1=3
1030 DIM F[7,15]
1040 V1=1
1050 V=1
1060 DIM Q$[3],Z1$[10],Z$[10]
1070 Z$="DUEL1.G101"
1080 Z1$="DUEL2.G101"
1090 FILES *
1100 ASSIGN Z$,1,R2
1110 READ #1;A
1120 IF A=0 THEN 1270
1130 REM TEAM ONE
1140 PRINT #1,1;0
1150 FOR L=1 TO 5
1160 ASSIGN Z1$,1,R2
1170 READ #1;A
1180 IF A=0 THEN 1330
1190 SYSTEM R2,"PAUSE-3"
1200 NEXT L
1210 PRINT "No opponents have been spotted as of yet, would you like to wait";
1220 INPUT O$
1230 IF O$[1,1]="Y" THEN 1150
1240 ASSIGN Z$,1,R2
1250 PRINT #1;1
1260 STOP
1270 REM TEAM TWO
1280 Z$="DUEL2.G101"
1290 Z1$="DUEL1.G101"
1300 ASSIGN Z$,1,R2
1310 PRINT #1;0
1320 ASSIGN Z1$,1,R2
1330 PRINT "Would you like an intro";
1340 INPUT O$
1350 IF O$[1,1]="Y" THEN 2780
1360 PRINT "Would you like to review the commands";
1370 INPUT O$
1380 IF O$[1,1]="N" THEN 1400
1390 GOSUB 2840
1400 PRINT "Both teams are launching "'26'26'26'26'26'26'26'26'26'26"HERE IS"
1410 MAT F=ZER
1420 F[3,4]=1
1430 F[5,4]=2
1440 F[4,6]=3
1450 F[3,12]=F[4,10]=F[5,12]=4
1460 FOR R=1 TO 7
1470 FOR C=1 TO 15
1480 IF F[R,C]#0 THEN 1510
1490 PRINT " ";
1500 GOTO 1560
1510 IF F[R,C]<4 THEN 1540
1520 PRINT "";
1530 GOTO 1560
1540 CONVERT F[R,C] TO F$
1550 PRINT "<";F$;">";
1560 NEXT C
1570 PRINT
1580 NEXT R
1590 ASSIGN Z1$,1,R2
1600 ADVANCE #1;V,R2
1610 IF END #1 THEN 1940
1620 READ #1;M
1630 GOTO M OF 1650,1770
1640 GOTO 1940
1650 READ #1;R,C,D
1660 V=V+4
1670 F[R,C]=4
1680 GOTO D OF 1690,1710,1730,1750
1690 F[R+1,C]=0
1700 GOTO 1610
1710 F[R,C+1]=0
1720 GOTO 1610
1730 F[R-1,C]=0
1740 GOTO 1610
1750 F[R,C-1]=0
1760 GOTO 1610
1770 READ #1;R,C
1780 V=V+3
1790 S1=S1-1
1800 IF S1>0 THEN 1900
1810 PRINT "SIR, out last ship has been destroyed"
1820 ASSIGN Z1$,1,R2
1830 IF ERROR THEN 1860
1840 PRINT #1;100
1850 GOTO 1830
1860 ASSIGN Z$,1,R2
1870 IF ERROR THEN 2890
1880 PRINT #1;100
1890 GOTO 1870
1900 PRINT "SIR, we lost another ship"
1910 PRINT "That leaves us with only";S1
1920 F[R,C]=0
1930 GOTO 1610
1940 PRINT "SIR, what are your orders--";
1950 ENTER 6,R2,O$
1960 PRINT
1970 IF R2=-1 OR R2=-256 THEN 1590
1980 IF O$="PF" THEN 1460
1990 IF O$="FL" THEN 2030
2000 IF O$="MS" THEN 2400
2010 GOSUB 2840
2020 GOTO 1590
2030 PRINT "Whichh of our ships is firing";
2040 INPUT S
2050 IF S<1 OR S>3 OR INT(S)#S THEN 2030
2060 PRINT "Which direction, Sir (1)N (2)E (3)S (4)W ";
2070 INPUT D
2080 IF D<1 OR D>4 OR INT(D)#D THEN 2060
2090 FOR R=1 TO 7
2100 FOR C=1 TO 15
2110 IF F[R,C]=S THEN 2160
2120 NEXT C
2130 NEXT R
2140 PRINT "That ship was already destroyed"
2150 GOTO 2030
2160 IF R=7 and D=3 OR R=1 AND D=1 OR C=1 AND D=4 OR C=15 AND D=2 THEN 2260
2170 GOTO D OF 2180,2200,2220,2240
2180 R=R-1
2190 GOTO 2250
2200 C=C+1
2210 GOTO 2250
2220 R=R+1
2230 GOTO 2250
2240 C=C-1
2250 IF F[R,C]>3 THEN 2280
2260 PRINT "SORRY SIR, we missed the enemy airship"
2270 GOTO 1590
2280 PRINT "SIR, we nailed one"'7
2290 S2=S2+1
2300 F[R,C]=0
2310 IF S2<3 THEN 2320
2320 PRINT S2;"DOWN";3-S2;"TO GO"
2330 ASSIGN Z$,1,R2
2340 ADVANCE #1;V1,R2
2350 PRINT #1;2,R,18-C
2360 V1=V1+3
2370 IF S2<3 THEN 1590
2380 PRINT "SIR, we have destroyed their entire fleet"
2390 GOTO 2890
2400 PRINT "Which ship sir";
2410 INPUT S
2420 IF S<1 OR S>3 OR INT(S)#S THEN 2400
2430 FOR R=1 TO 7
2440 FOR C=1 TO 15
2450 IF F[R,C]=S THEN 2500
2460 NEXT C
2470 NEXT R
2480 PRINT "SORRY SIR, that ship has been destroyed"
2490 GOTO 1590
2500 PRINT "Which direction------(1)north (2)east (3)south (4)west";
2510 INPUT D
2520 IF D<1 OR D>4 OR INT(D)#D THEN 2500
2530 IF D=1 AND R=1 OR D=2 AND C=15 OR D=3 AND R=7 OR D=4 AND C=1 THEN 2550
2540 GOTO 2570
2550 PRINT "SORRY SIR, that is out of bounds"
2560 GOTO 1590
2570 R1=R
2580 C1=C
2590 GOTO D OF 2600,2620,2640,2660
2600 R=R-1
2610 GOTO 2670
2620 C=C+1
2630 GOTO 2670
2640 R=R+1
2650 GOTO 2670
2660 C=C-1
2670 IF F[R,C]<1 THEN 2700
2680 PRINT "We can't do that sir, we would have to ram a ship."
2690 GOTO 1590
2700 PRINT "Movement completed"
2710 F[R1,C1]=0
2720 F[R,C]=S
2730 ASSIGN Z$,1,R2
2740 ADVANCE #1;V1,R2
2750 PRINT #1;1,R,18-C,D
2760 V1=V1+4
2770 GOTO 1590
2780 PRINT "In this battle you control 3 airships against 3 enemy"
2790 PRINT "airships. To fire your lasers at a ship, you must be"
2800 PRINT "right next to them. Then you may fire either north, "
2810 PRINT "south, east, or west. Here is a list of legal orders:"
2820 GOSUB 2840
2830 GOTO 1400
2840 PRINT "MS-----------------move ship"
2850 PRINT "FL---------------fire lasers"
2860 PRINT "PF--------------print format"
2870 PRINT "LC------------list commaneds"
2880 RETURN
2890 END
| |