MIDWAY
by
Bob Cockroft
It is the morning of June 4, 1942 as the American fleet waits silently north of Midway Island in anticipation of a major Japanese attack. Having broken the Japanese message code, the Americans had learned that the enemy is planning to invade this outermost Island of the Hawaiian chain. As a result, they committed the balance of their Pacific fleet to defend the Island. Being only six months after Pearl Habour, the american naval forces are severely depleted and greatly outnumbered by the Japanese. You, as the American commander have only eleven ships at your disposal; three aircraft carriers, six heavy cruiser and two light cruisers. The carriers are the most important ships in the fleet. As a result, they should be protected at all costs. The whether battle will be won or lost will depend upon how effectively the aircraft are used. It has been rumoured that the Japanese would like to use Midway as a base from which to launch bomber attacks against Hawaii.
For a BASIC program, this game is quite complex. It uses 48K, and a couple of screens and has many options. Carefully read the following instructions, they will be helpful if not necessary in order to play. After the game has been initialized, the first phase begins. It will consist of a map of the Midway area. The map includes two islands: Kure, the upper, and Midway, the lower island. In addition, the American ships and reconnaissance aircraft are displayed. You may have noticed that there are no Japanese ships. The reason for this is that the exact location of the invading fleet is unknown. Intelligence has only determined that the enemy will move towards Midway from the western side of the map. The invader's ships exact location will need to be discovered by reconnaissance aircraft or surface patrols. Careful examination reveals two distinctive types of american ships. On the one hand, cruisers are displayed as ships with turrets and other armaments. On the other, carriers are displayed with their unmistakable flat top. At the top of the screen the name of the first ship you are to move is displayed. Using the joystick, move the ship in the direction you wish. A maximum of two spaces is allowed in any one direction. When you have moved the ship to the desired position, press the joystick trigger and repeat this procedure for the eleven ships in the fleet, remembering that the name of the moving ship is displayed at the top of the screen. After all the ships have been shifted, the same procedure is used for moving the reconnaissance aircraft. These planes can move as many as ten spaces in any one direction. Because the Japanese fleet will move towards Midway Island from the western side of the map, it is usually best for the reconnaissance aircraft to move west in order to find the exact location of the fleet.
After all the reconnaissance aircraft have been moved, the search phase will begin. If there is a Japanese force on the same space as an American ship or within one space of a reconnaissance plane, an `x' will be displayed on the map to pinpoint its location. In addition, the composition and position coordinates of the enemy force are displayed at the top of the map. The force that has been sighted can be composed of five different types of ships. In order to save space, each class of ship is represented by its naval symbol: Heavy carriers CV, light carriers CVL, battleships BB, heavy cruiser CA and light cruiser CL. The coordinates are given in X,Y form. They should be written down so that the forces can be tracked. Moreover, these coordinates could later be needed for your attacking aircraft. There could be a number of sightings on any given turn. Press the SPACE BAR after recording the numbers in order to continue the game.
When the search phase is completed, you will have the following options: 1.check fleet status, 2.call an air attack or 3.continue to the Japanese phase.
If you want to check the fleet or attack, press "S". Immediately the screen will display the american ships and two corresponding columns of numbers. The first column, under the subheading of DGE, represents the amount of damage the ship has sustained. The second column, under the subheading of HSR, represents the ships hull strength. If the damage number exceeds the hull strength the ship will sink. All ships that are already sunk will not be displayed. At the bottom of the screen, the computer will ask if you wish to call an air attack. A "N" response will cause the game to jump back to the map. A "Y" will cause the computer to respond with a series of questions. These would include the number of fighters and bombers and the coordinates of the force to be attacked. The bombers will automatically attempt to concentrate their attack on enemy carriers, while the fighters try to engage any ZEROS in the area. Bombers unprotected by fighter escort will be easy prey for ZEROS.
The next phase is the one in which the Japanese move, search and possibly attack. The Japanese will move their reconnaissance plans in search of your ships. If they have made a sighting and you are in range, an air attack is possible. In addition, if a Japanese ship moves adjacent to one of your own, a surface battle will automatically occur.
After this last phase has been completed, the computer will return to the first phase and start the process over again for the second turn. There is no limit to the number of game turns. The game is only completed by sinking enough Japanese ships to force them to retreat(you win) or by loosing Midway Island(the Japanese win).
The Battle of Midway was the turning point of the War in the Pacific. Although outnumbered, the Americans scored a major victory. By sinking four of Japan's largest aircraft carriers, the Americans stopped the Japanese offensive. A major victory determinant in both the Battle and this game, is the ability to locate the opponents carriers before he locates yours. In other words, the effective use of reconnaissance is vitally important to success.
1 DIM SHIP$(20),XPSP(11),YPSP(11),XPRC(4),YPRC(4),CL$(10),CA$(10),CV$(10),LIV(11),MAP(39,23)
2 XPSP(1)=29:XPSP(2)=28:XPSP(3)=29:XPSP(4)=30:XPSP(5)=31:XPSP(6)=32:XPSP(7)=32:XPSP(8)=29:XPSP(9)=35:XPSP(10)=35
3 XPSP(11)=35
4 YPSP(1)=5:YPSP(2)=7:YPSP(3)=9:YPSP(4)=10:YPSP(5)=11:YPSP(6)=13:YPSP(7)=14:YPSP(8)=6:YPSP(9)=12:YPSP(10)=13
5 YPSP(11)=14:XPRC(1)=28:XPRC(2)=28:XPRC(3)=28:XPRC(4)=28:YPRC(1)=10:YPRC(2)=13:YPRC(3)=16:YPRC(4)=19
6 DIM HUST(11),DAMG(11):HUST(1)=3:HUST(2)=3:FOR X=3 TO 5:HUST(X)=4:NEXT X:FOR X=6 TO 11:HUST(X)=5:NEXT X
7 CL$="LT CRUSIER":CA$="HY CRUSIER":CV$="CARRIER "
8 DIM BGAX(9),BGAY(9),GOAL(33)
10 FOR X=1 TO 11:LIV(X)=0:DAMG(X)=0:NEXT X
12 FOR X=1 TO 3:POKE 1539+X-1,20:POKE 1542+X-1,9:NEXT X
14 GOAL=4320:GOAL(31)=0:GOAL(32)=0
17 FOR X=1 TO 32:GOAL(X)=0:NEXT X
110 RT=PEEK(106)-4
120 NT=RT*256
130 POKE 106,PEEK(106)-5
134 GOAL(33)=4320
135 GRAPHICS 0:POKE 752,1:POSITION 17,8:? "MIDWAY":POSITION 15,10:? "Please Wait"
140 FOR X=1 TO 1024:POKE NT-1+X,PEEK(57344-1+X):NEXT X
145 FOR X=1 TO 39:FOR Y=1 TO 23:MAP(X,Y)=0:NEXT Y:NEXT X
146 FOR X=1 TO 4
147 BGAY(X)=INT(RND(0)*10)+5
148 BGAX(X)=1
149 MAP(BGAX(X),BGAY(X))=MAP(BGAX(X),BGAY(X))+10
150 NEXT X
170 POKE 756,NT/256:LOCX=0:L000X=0
172 POKE 1600,0:POKE 1601,0
180 FOR X=1 TO 6
190 READ LOC
200 S=NT+LOC*8
210 FOR W=0 TO 7:READ D
220 POKE S+W,D
230 NEXT W
240 NEXT X
300 GRAPHICS 0:A=PEEK(106):DL11=PEEK(560):DL12=PEEK(561):P88=PEEK(88):P89=PEEK(89):POKE 752,1
310 POSITION 32,16:? "&":POSITION 29,14:? "("
400 POKE 106,A-16
405 GRAPHICS 0:DL21=PEEK(560):DL22=PEEK(561):P881=PEEK(88):P891=PEEK(89)
2000 POKE 560,DL11:POKE 561,DL12:POKE 756,NT/256:POKE 106,A:POKE 88,P88:POKE 89,P89:POKE 752,1
2001 IF PEEK(1601)=1 THEN POSITION 0,0:? " JAPANESE RETREATING 'you win' ":POSITION 3,1:? "SCORE: ";GOAL(31);
2002 IF PEEK(1601)=1 THEN ? " ":END
2003 GOAL(32)=GOAL(32)+1
2004 IF GOAL(32)=3 THEN BGAX(5)=1:MAP(BGAX(5),BGAY(5))=120
2005 IF GOAL(32)=7 THEN BGAX(6)=1:BGAY(6)=INT(RND(0)*10)+5:MAP(BGAX(6),BGAY(6))=10
2006 IF GOAL(32)=8 THEN FOR X=7 T0 9:BGAX(X)=1:MAP(BGAX(X),BGAY(X))1:NEXT X
2007 IF GOAL(32)=5 THEN BGBX=1:BGBY=INT(RND(0)*15)+3:MAP(BGBX,BGBY=4320
2008 IF GOAL(32)=12 THEN POKE 1537,1:POKE 1538,14:MAP(PEEK(1537),PEEK(1538))=300
2009 IF GOAL(32)<12 THEN POKE 1537,1
2010 FOR X=1 TO 11
2011 IF LIV(X)>0 THEN 2280
2012 IF X=1 THEN XPS=XPSP(1):YPS=YPSP(1):SHIP$="Portland it :XPSP(1)=0
2013 IF X=2 THEN XPS=XPSP(2):YPS=YPSP(2):SHIP$="Atlanta it :XPSP(2)=0
2014 IF X=3 THEN XPS=XPSP(3):YPS=YPSP(3):SHIP$="Pensacola ":XPSP(3)=0
2015 IF X=4 THEN XPS=XPSP(4):YPS=YPSP(4):SHIP$="New Orleans":XPSP(4)=0
2016 IF X=5 THEN XPS=XPSP(5):YPS=YPSP(5):SHIP$="Astoria to :XPSP(5)=0
2017 IF X=6 THEN XPS=XPSP(6):YPS=YPSP(6):SHIP$="Minneopolis":XPSP(6)=0
2018 IF X=7 THEN XPS=XPSP(7):YPS=YPSP(7):SHIP$="Vincennes ":XPSP(7)=0
2019 IF X=8 THEN XPS=XPSP(8):YPS=YPSP(8):SHIP$="Northampton":XPSP(8)=0
2020 IF X=9 THEN XPS=XPSP(9):YPS=YPSP(9):SHIP$="Yorktown ":XPSP(9)=0
2021 IF X=10 THEN XPS=XPSP(10):YPS=YPSP(10):SHIP$="Enterprice ":XPSP(10)=0
2022 IF X=11 THEN XPS=XPSP(11):YPS=YPSP(11):SHIP$="Hornet ":XPSP(11)=0
2023 POSITION 0,0:? " ":POSITION 0,1:? " ";SHIP$;"
2024 XP=XPS,:YP=YPS
2025 ST=STICK(0)
2027 IF X>8 THEN POSITION XP,YP:? "%":GOTO 2030
2030 IF ST=14 THEN POSITION XP,YP:? " ":YP=YP-1:GOTO 2065
2032 IF ST=10 THEN POSITION XP,YP:? " ":YP=YP-1:XP=XP-1:GOTO 2065
2034 IF ST=6 THEN POSITION XP,YP:? " ":YP=YP-1:XP=XP+1:GOTO 2065
2036 IF ST=9 THEN POSITION XP,YP:? " ":YP=YP+1:XP=XP-1:GOTO 2065
2038 IF ST=5 THEN POSITION XP,YP:? " ":YP=YP+I:XP=XP+1:GOTO 2065
2040 IF ST=13 THEN POSITION XP,YP:? " ":YP=YP+1:GOTO 2065
2050 IF ST=7 THEN POSITION XP,YP:? " ":XP=XP+1:GOTO 2065
2060 IF ST=11 THEN POSITION XP,YP:? " ":XP=XP-1:GOTO 2065
2065 IF XP<1 THEN XP=1
2070 IF XP>35 THEN XP=35
2075 IF YP<1 THEN YP=1
2080 IF YP>22 THEN YP=22
2085 POSITION 32,16:? "&":POSITION 29,14:? "("
2090 IF (XP-XPS)>2 THEN XP=XPS+2
2100 IF (XP-XPS)<-2 THEN XP=XPS-2
2110 IF (Y-P-YPS)>2 THEN YP=YPS+2
2115 IF (YP-YPS)<-2 THEN YP=YPS-2
2120 IF X>8 THEN POSITION XP,YP:? "%":GOTO 2122
2121 POSITION XP,YP:?
2122 FOR S=1 TO 11
2124 IF LIV(S)>0 OR XPSP(S)=0 THEN POSITION XPSP(S),YPSP(S):? " ":GOTO 2130
2126 IF S>8 THEN POSITION XPSP(S),YPSP(S):? "%":GOTO 2130
2128 POSITION XPSP(S),YPSP(S):? "$"
2130 NEXT S
2132 FOR WW=1 TO 4
2134 POSITION XPRC(WW),YPRC(WW):? "#"
2136 NEXT WW
2150 IF STRIG(0)=0 THEN 2170
2160 GOTO 2025
2170 XPSP(X)=XP:YPSP(X)=YP
2280 NEXT X
2900 GOTO 4000
4000 POKE 560,DL11:POKE 561,DL12:POKE 756,NT/256:POKE 106,A:POKE 88,P88:POKE 89,P89:POKE 752,1
4010 X=1
4020 XP=XPRC(X):YP=YPRC(X):XPRC(X)=0
4025 XPS=XP:YPS=YP
4030 POSITION 0,0:? " RECON ";X;" ":POSITION 0,1:? "
4040 ST=STICK(0)
4050 IF ST=14 THEN POSITION XP,YP:? " ":YP=YP-1:GOTO 4130
4060 IF ST=10 THEN POSITION XP,YP:? " ":YP=YP-1:XP=XP-1:GOTO 4130
4070 IF ST=6 THEN POSITION XP,YP:? " ":YP=YP-1:XP=XP+1:GOTO 4130
4080 IF ST=9 THEN POSITION XP,YP:? " ":YP=YP+1:XP=XP-1:GOTO 4130
4090 IF ST=5 THEN POSITION XP,YP:? " ":YP=YP+1:XP=XP+1:GOTO 4130
4100 IF ST=13 THEN POSITION XP,YP:? " ":YP=YP+1:GOTO 4130
4110 IF ST=7 THEN POSITION XP,YP:? " ":XP=XP+1:GOTO 4130
4120 IF ST=11 THEN POSITION XP,YP:? " ":XP=XP-1:GOTO 4130
4130 IF XP<1 THEN XP=1
4140 IF XP>38 THEN XP=38
4150 IF YP<1 THEN YP=1
4160 IF YP>22 THEN YP=22
4170 POSITION 32,16:? "&":POSITION 29,14:? "("
4180 IF (XP-XPS)>10 THEN XP=XPS+10
4190 IF (XP-XPS)<-10 THEN XP=XPS-10
4200 IF (YP-YPS)>10 THEN YP=YPS+10
4210 IF (YP-YPS)<-10 THEN YP=YPS-10
4215 POSITION XP,YP:?
4217 FOR W=1 TO 11
4218 IF LIV(W)>0 THEN POSITION XPSP(W),YPSP(W):? " ":GOTO 4221
4219 IF W>8 THEN POSITION XPSP(W),YPSP(W):? "°!,":GOTO 4221
4220 POSITION XPSP(W),YPSP(W):? "
4221 NEXT W
4223 FOR W=1 TO 4
4230 IF XPRC(W)=0 THEN 4250
4240 POSITION XPRC(W),YPRC(W):? "#"
4250 NEXT W
4260 IF STRIG(0)=0 THEN 4280
4270 GOTO 4040
4280 XPRC(X)=XP:YPRC(X)=YP
4290 X=X+1:IF X<5 THEN 4020
4300 FOR R=1 TO 4
4310 FOR WW=(XPRC(R)-1) TO (XPRC(R)+1)
4320 FOR WY=(YPRC(R)-1) TO (YPRC(R)+1)
4330 IF MAP(WW,WY)>0 THEN 4350
4334 NEXT WY:NEXT WW
4340 NEXT R
4345 GOTO 4510
4350 POSITION 0,0:? " Sighting: LOC ";WW;" ";WY;" "
4360 DA=MAP(WW,WY)
4380 C1=(DA/10000)
4390 CVL=INT(C1)
4400 C2=(C1-CVL)*10
4410 CVS=INT(C2)
4420 C3=(C2-CVS)*10
4430 BBS=INT(C3)
4440 C4=(C3-BBS)*10
4450 CAS=INT(C4)
4460 CLS=INT((C4-CAS)*10)
4470 POSITION 0,1:? " CV ";CVS;" CVL ";CVL;" BB ";BBS;" CA ";CAS;" CL ";CLS
4472 POSITION WW,WY:?
4473 POKE 764,255
4475 IF PEEK(764)=33 THEN 4477
4476 GOTO 4475
4477 POKE 764,255
4478 POSITION WW,WY:? " "
4479 FOR X=1 TO 4
4480 IF WW=XPRC(X) AND WY=YPRC(X) THEN POSITION WW,WY:? "#":GOTO 4495
4485 NEXT X
4495 IF BUS=1 THEN 4535
4500 GOTO 4334
4510 BUS=1
4520 WSS=1
4522 COUNT=WSS+1
4524 FOR LO=COUNT TO 11
4525 IF XPSP(WSS)=XPSP(LO) AND YPSP(WSS)=YPSP(LO) THEN COUNT=COUNT+1:GOTO 4535
4527 NEXT LO
4528 COUNT=COUNT+1
4530 IF MAP(XPSP(WSS),YPSP(WSS))>0 THEN WW=XPSP(WSS):WY=YPSP(WSS):GOTO 4350
4535 WSS=WSS+1
4540 IF WSS<11 THEN 4524
4550 BUS=0
4560 FOR W=1 TO 11
4562 IF LIV(W)>0 THEN POSITION XPSP(W),YPSP(W):? " ":XPSP(W)=0:GOT0 4590
4570 IF W>8 THEN POSITION XPSP(W),YPSP(W):? "%":GOTO 4600
4580 POSITION XPSP(W),YPSP(W):? "$"
4590 NEXT W
4600 POSITION 0,0:? "Press 'S' for FLEET STATUS or to ATTACK"
4605 POSITION 0,1:? " Press SPACE BAR to continue ":POKE 764,255
4610 IF PEEK(764)=62 THEN POKE 1562,125:GOTO 8000
4620 IF PEEK(764)<>33 THEN 4610
4630 POKE 752,1:POSITION 0,0:? "
4635 POSITION 0,1:? " Press SPACE BAR to continue "
4640 IF PEEK(764)<>33 THEN 4640
4645 POSITION 0,1:? "
4650 GOTO 10000
8000 POKE 560,DL21:POKE 561,DL22:POKE 88,P881:POKE 89,P891:POKE 106,AA:POKE 756,224:POKE 764,255
8002 POSITION 0,3
8003 FOR X=1 TO 12
8005 ? "
8006 NEXT X"
8010 POSITION 14,0:? "Fleet Status"
8020 ? :? " NAME: CLASS DGE HSREN":?
8030 FOR W=11 TO 1 STEP -1
8035 IF LIV(W)>0 THEN 8200
8040 IF W=11 THEN ? "Hornet ";CV$;" ";DAMG(W);" ";HUST(W)
8050 IF W=10 THEN ? "Enterprise ";CV$;" ";DAMG(W);" ";HUST(W)
8060 IF W=9 THEN ? "Yorktown ";CV$;" ";DAMG(W);" ";HUST(W)
8070 IF W=8 THEN ? "Northampton ";CA$;" ";DAMG(W);" ";HUST(W)
8080 IF W=7 THEN ? "Vincenes ";CA$;" ";DAMG(W);" ";HUST(W)
8090 IF W=6 THEN ? "Minneopolis ";CA$;" ";DAMG(W);" ";HUST(W)
8100 IF W=5 THEN ? "Astoria ";CA$;" ";DAMG(W);" ";HUST(W)
8110 IF W=4 THEN ? "New Orleans ";CA$;" ";DAMG(W);" ";HUST(W)
8120 IF W=3 THEN ? "Pensacola ";CA$;" ";DAMG(W);" ";HUST(W)
8130 IF W=2 THEN ? "Atlanta ";CL$;" ";DAMG(W);" ";HUST(W)
8140 IF W=1 THEN ? "Portland ";CL$;" ";DAMG(W);" ";RUST(W)
8150 IF DAMG(W)>=HUST(W) THEN DAMG(W)=HUST(W):LIV(W)=1
8200 NEXT W
8210 IF LIV(11)=0 THEN POSITION 2,16:? "Hornet ";PEEK(1539);"B.SQD ";PEEK(1542);" F.SQD":GOTO 8220
8215 POSITION 2,16:? " "
8220 IF LIV(10)=0 THEN POSITION 2,17:? "Enterprise ";PEEK(1540);"B.SQD ";PEEK(1543);" F.SQD":GOTO 8230
8225 POSITION 2,17:? " "
8230 IF LIV(9)=0 THEN POSITION 2,18:? "Yorktown ";PEEK(1541);" B.SQR ";PEEK(1544);" F.SQD ":GOTO 8500
8235 POSITION 2,18:? " "
8500 GOTO 15000
10000 FOR X=1 TO 9
10156 GOAL(X)=MAP(BGAX(X),BGAY(X)):MAP(BGAX(X),BGAY(X))=0
10160 IF GOAL(11+X)=1 THEN 10250
10180 BGAX(X)=BGAX(X)+2
10190 BGAY(X)=BGAY(X)+(INT(RND(0)*4)-1)
10200 IF BGAX(X)>33 THEN GOAL(11+X)=1
10205 IF BGAY(X)>20 THEN BGAY(X)=BGAY(X)-2
10210 IF BGAY(X)<6 THEN BGAY(X)=BGAY(X)+2
10220 GOTO 10420
10250 BGAX(X)=BGAX(X)+(INT(RND(0)*4)-1)
10260 BGAY(X)=BGAY(X)+(INT(RND(0)*4)-1)
10270 IF BGAX(X)>37 THEN BGAX(X)=37
10280 IF BGAX(X)<25 THEN BGAX(X)=25
10290 IF BGAY(X)>6 THEN BGAY(X)=6
10300 IF BGAY(X)>17 THEN BGAY(X)=17
10420 MAP(BGAX(X),BGAY(X))=MAP(BGAX(X),BGAY(X))+GOAL(X)
10425 NEXT X
10430 GOTO 10500
10499 REM BATTLE GROUP B
10500 GOAL(10)=MAP(BGBX,BGBY):MAP(BGBX,BGBY)=0
10510 IF LOCCX=0 THEN 10700
10520 IF BGBX<LOCCX-7 THEN BGBX=BGBX+3:GOTO 10600
10540 IF BGBX>LOCCX+7 THEN BGBX=BGBX-1:GOTO 10600
10550 IF BGBY<(PEEK(1536)-7) THEN BGBY=BGBY+2:GOTO 10600
10560 IF BGBY>(PEEK(1536)+7) THEN BGBY=BGBY-2:GOTO 10600
10580 BGBY=BGBY+INT(RND(0)*4)-2
10600 IF BGBX>37 THEN BGBX=37
10610 IF BGBX<27 THEN BGBX=BGBX+2
10620 IF BGBY>19 THEN BGBY=19
10630 IF BGBY<4 THEN BGBY=4
10640 GOTO 10800
10700 IF BGBX<25 THEN BGBX=BGBX+2
10710 IF BGBX>37 THEN BGBX=BGBX-2
10720 IF BGBY<9 THEN BGBY=BGBY+2
10730 IF BGBY>19 THEN BGBY=BGBY-2
10740 IF GOAL(10)>0 THEN GOAL(33)=GOAL(10)
10800 MAP(BGBX,BGBY)=MAP(BGBX,BGBY)+GOAL(33)
10805 IF GOAL(33)<1000 AND GOAL(32)>10 THEN POKE 1601,1
10810 GOAL(11)=MAP(PEEK(1537),PEEK(1538)):MAP(PEEK(1537),PEEK(1538))=0
10820 IF PEEK(1537)=31 THEN POKE 1537,32
10830 IF PEEK(1537)<32 THEN POKE 1537,PEEK(1537)+2
10840 IF PEEK(1538)<16 THEN POKE 1538,PEEK(1538)+1
10850 IF PEEK(1538)>16 THEN POKE 1538,PEEK(1538)-1
10860 MAP(PEEK(1537),PEEK(1538))=MAP(PEkK(1537),PEEK(1538))+GOAL(11)
10870 GOTO 18000
15000 POKE 560,DL21:POKE 561,DL22:POKE 88,P88:POKE 89,P891:POKE 106,AA:POKE 752,0
15005 POSITION 0,21:? "
15010 POSITION 0,20:? " Send planes (Y or N) if :INPUT SHIP$
15100 IF SHIP$="Y" THEN 15120
15110 GOTO 16050
15120 POSITION 1,20:? "To where 'X,Y' ":INPUT X,W:POSITION 0,22:? " "
15125 POKE 1547,X:POKE 1548,W
15127 POSITION 1,21:? " "
15130 POSITION 1,20:? "From where (1st letter of carrier/mid":INPUT SHIP$
15140 IF SHIP$="H" THEN X=11:GOTO 15190
15150 IF SHIP$="E" THEN X=10:GOTO 15190
15160 IF SHIP$="Y" THEN X=9:GOTO 15190
15180 GOTO 15130
15190 IF ABS(XPSP(X)-PEEK(1547))<7 AND ABS(YPSP(X)-PEEK(1548))<7 THEN 15210
15200 POSITION 1,20:? "Target is too far away ":FOR W=1 TO 75:NEXT W:GOTO 15010
15210 POSITION 1,21:? " ":POSITION 1,20:? "How many bombers ? ":INPUT S
15215 IF X=11 AND S>PEEK(1539) THEN 15210
15217 IF X=10 AND S>PEEK(1540) THEN 15210
15218 IF X=9 AND S>PEEK(1541) THEN 15210
15230 POSITION 1,21:? " ":POSITION 1,20:? "how many fighters? ":INPUT W
15232 IF X=11 AND W>PEEK(1542) THEN 15230
15234 IF X=10 AND W>PEEK(1543) THEN 15230
15236 IF X=9 AND W>PEEK(1544) THEN 15230
15250 IF SHIP$="H" THEN POKE 1551,S:POKE 1552,W
15260 IF SHIP$="E" THEN POKE 1553,S:POKE 1554,W
15270 IF SHIP$="Y" THEN POKE 1555,S:POKE 1556,W
15280 POSITION 1,21:? " ":POSITION 1,20:? "Send more planes?(Y/N) or A to abort ":INPUT SHIP$
15285 TRAP 15280
15290 IF SHIP$="Y" THEN 15130
15295 IF SHIP$="A" THEN 16050
15300 DA=MAP(PEEK(1547),PEEK(1548))
15330 C2--DA/1000
15340 CVS=INT(C2)
15350 C3=(C2-CVS)*10
15360 BBS=INT(C3)
15370 C4=(C3-BBS)*10
15380 CAS=INT(C4)
15390 CLS=INT((C4-CAS)*10)
15400 X=(CVS+CAS)*3+BBS*6+CLS
15500 W=(PEEK(1551)+PEEK(1553)+PEEK(1555))/X*3
15510 S=INT(RND(0)*4)+1
15520 IF W<4 THEN 15580
15530 IF S=1 THEN W=7:S=5
15540 IF S=2 THEN W=9:S=4
15550 IF S=3 THEN W=10:S=3
15560 IF S=4 THEN W=12:S=2
15570 GOTO 15730
15580 IF W<3 THEN 15640
15590 IF S=1 THEN W=3:S=6
15600 IF S=2 THEN W=5:S=5
15610 IF S=3 THEN W=7:S=4
15620 IF S=4 THEN W=10:S=3
15630 GOTO 15730
15640 IF W<2 THEN 15722
15650 IF S=1 THEN W=2:S=7
15660 IF S=2 THEN W=3:S=6
15670 IF S=3 THEN W=5:S=5
15680 IF S=4 THEN W=7:S=4
15722 DA=CVS*5-(PEEK(1552)+PEEK(1554)+PEEK(1556))
15724 IF DA>0 THEN S=S+DA
15730 S=INT(S/3)+1
15740 IF PEEK(1551)>S THEN POKE 1551,S:GOTO 15760
15750 POKE 1551,0
15760 IF PEEK(1553)>S THEN POKE 1553,S:GOTO 15780
15770 POKE 1551,0
15780 IF PEEK(1555)>S THEN POKE 1555,S:GOTO 15790
15785 POKE 1551,0
15790 DA=PEEK(1552)+PEEK(1554)+PEEK(1556)
15800 DA=DA-(INT(RND(0)*3)+1)*CVS
15810 DA=INT(DA/3):IF DA<0 THEN DA=0
15820 POKE 1552,DA:POKE 1554,DA:POKE 1556,DA
15828 GOAL(23)=0:GOAL(24)=0:GOAL(25)=0:GOAL(26)=0
15830 IF CVS>0 AND W>5 THEN CVS=CVS-1:W=W-5:MAP(BGBX,BGBY)=MAP(BGBX,BGBY)-1000:GOAL(33)=GOAL(33)-1000:GOTO 15835
15832 GOTO 15850
15835 GOAL(23)=GOAL(23)+1
15840 IF W>4 THEN 15830
15850 IF CAS>0 AND W>2 THEN CAS=CAS-1:W=W-3:GOAL(33)=GOAL(33)-10:GOTO 15855
15852 GOTO 15870
15855 GOAL(24)=GOAL(24)+1
15860 IF W>2 THEN 15850
15870 IF CLS>0 AND W>1 THEN CLS=CLS-1:W=W-2:GOAL(33)=GOAL(33)-1:GOTO 15875
15872 GOTO 15890
15875 GOAL(25)=GOAL(25)+1
15880 IF W>1 THEN 15870
15890 IF BBS>0 AND W>6 THEN BBS=BBS-1:W=W-7:GOAL(33)=GOAL(33)-100:GOTO 15895
15892 GOTO 15910
15895 GOAL(26)=GOAL(26)+1
15900 IF W>6 THEN 15890
15910 POKE 1540,ABS(PEEK(1540)-PEEK(1553))
15920 POKE 1539,PEEK(1540)
15930 POKE 1541,ABS(PEEK(1541)-PEEK(1555))
15940 POKE 1542,ABS(PEEK(1542)-PEEK(1552))
15950 POKE 1543,ABS(PEEK(1543)-PEEK(1554))
15960 POKE 1544,ABS(PEEK(1544)-PEEK(1556))
16000 IF LIV(11)=0 THEN POSITION 2,16:? "Hornet ";PEEK(1539);"B.SQD ";PEEK(1542);" F.SQD":GOTO 16010
16005 POSITION 2,16:? ""
16010 IF LIV(10)=0 THEN POSITION 2,17:? "Enterprise ";PEEK(1540);"B.SQD ";PEEK(1543);" F.SQD ":GOTO 16020
16015 POSITION 2,17:? " "
16020 IF LIV(9)=0 THEN POSITION 2,18:? "Yorktown ";PEEK(1541);"B.SQR ";PEEK(1544);" F.SQD":GOTO 16030
16025 POSITION 2,18:? " "
16030 ? :POSITION 0,20:? "Ships sunk: ";GOAL(23);" CV ";GOAL(26);" BB ";GOAL(24);" CA ";GOAL(25);" CL "
16035 ? " press SPACE BAR to continue":POKE 764,255
16040 IF PEEK(764)<>33 THEN 16040
16050 POKE 560,DL11:POKE 561,DL12:POKE 88,P88:POKE 89,P89:POKE 756,NT/256
16052 POSITION 0,0:? " ":POSITION 0,1:? "Press SPACE BAR to continue
16060 GOTO 4600
18000 IF PEEK(1537)=32 AND PEEK(1538)=16 THEN POSITION 0,0:7 " Japanese are invading midway "
18002 IF PEEK(1537)=32 AND PEEK(1538)=16 THEN POKE 1600,PEEK(1600)+1
18003 IF PEEK(1600)>5 THEN POSITION 0,0:? " MIDWAY TAKEN BY JAPANESE 'you lose"':POSITION 10,1:? "Score: ";GOAL(31);
18004 IF PEEK(1600)>5 THEN ? " ":END
18005 X=INT(RND(0)*8)+1:IF LOCCX=1 THEN X=X+3
18006 CLS=0
18010 IF X>4 THEN LOCCX=1:GOTO 18030
18015 LOCCX=0
18020 GOTO 18240
18030 LOCCX=1
18031 FOR X=9 TO 11
18040 IF ABS(BGBX-XPSP(X))<7 AND ABS(BGBY-YPSP(X))<7 THEN POKE 1560,XPSP(X):POKE 1561,YPSP(X):GOTO 18070
18050 NEXT X
18060 GOTO 18020
18070 DA=MAP(BGBX,BGBY)
18080 CVS=INT(DA/1000)
18090 W=INT(RND(0)*4)*CVS:CLS=0
18100 FOR X=9 TO 11
18110 IF LIV(X)=0 THEN 18150
18120 NEXT X
18130 GOTO 18020
18150 DAMG(X)=DAMG(X)+W
18160 IF DAMG(X)>HUST(X) THEN DAMG(X)=HUST(X):W=W-HUST(X):LIV(X)=1:CLS=CLS+1:GOTO 18100
18200 POKE 560,DL11:POKE 561,DL12:POKE 88,P88:POKE 89,P89:POKE 756,NT/256
18210 POSITION 4,0:? " JAP Air Attack"
18220 POSITION PEEK(1560),PEEK(1561):? ")"
18230 POSITION 13,1:? CLS," Carriers sunk":GOAL(31)=GOAL(31)+CLS*5
18232 POKE 764,255
18234 IF PEEK(764)<>33 THEN 18234
18240 FOR X=1 TO 11
18250 IF MAP(XPSP(X),YPSP(X))>0 THEN 18270
18260 NEXT X
18265 GOTO 19000
18270 DA=MAP(XPSP(X),YPSP(X))
18300 C2=(DA/1000)
18310 CVS=INT(C2)
18320 C3=(C2-CVS)*10
18330 BBS=INT(C3)
18340 C4=(C3-BBS)*10
18350 CAS=INT(C4)
18360 CLS=INT((C4-CAS)*10):BBS=0
18370 IF INT(RND(0)*3)+1=1 THEN LIV(X)=1:DAMG(X)=HUST(X):GOTO 18380
18375 DAMG(X)=DAMG(X)+INT(RND(0)*3)+1
18376 IF DAMG(X)>HUST(X) THEN DAMG(X)=HUST(X)
18380 IF CAS>1 AND INT(RND(0)*10)>8 THEN MAP(XPSP(X),YPSP(X))=MAP(XPSP(X),YPSP(X))-10:BBS=1
18390 IF CLS>1 AND INT(RND(0)*10)>5 THEN MAP(XPSP(X),YPSP(X))=MAP(XPSP(X),YPSP(X))-1:BBS=1
18400 IF CVS>1 AND INT(RND(0)*10)>9 THEN MAP(XPSP(X),YPSP(X))=MAP(XPSP(X),YPSP(X))-1000:CVL=1
18,10 POKE 560,DL11:POKE 561,DL12:POKE 88,P88:POKE 89,P89
18420 POSITION 0,0:? " Surface contact: SHIP/S/ LOST: ";LIV(X)
18430 ? " Japanese sunk: ";CVL+BBS;" ":GOAL(31)=GOAL(31)+CVL+BBS
18440 POSITION XPSP(X),YPSP(X):?
18500 POKE 764,255
18510 IF PEEK(764)<>33 THEN 18510
18520 GOTO 18260
19000 GOTO 2000
20010 DATA 3,0,0,121,35,255,120,0,0
20020 DATA 4,0,16,16,54,255,126,0,0
20030 DATA 5,0,0,4,12,255,126,0,0
20040 DATA 6,84,130,16,157,48,66,36,0
20050 DATA 8,0,96,24,60,12,10,16,0
20060 DATA 9,0,66,36,24,24,36,66,0
0 REM * CHECK DATA *
1 DATA 8226,367,99,913,889,287,720,396,912,755,415,120,204,182,922,488,75,482
140 DATA 9380,406,671,82,772,913,78,776,267,652,82,879,2,517,995,774,776,738
310 DATA 9535,735,78,491,739,483,493,483,508,919,828,490,725,200,168,643,821,731
2014 DATA 7588,881,958,760,79,920,102,893,154,870,3,407,127,38,709,256,213,218
2038 DATA 7685,214,707,661,707,489,597,492,592,794,162,199,159,209,34,684,167,818
2126 DATA 10381,688,345,819,213,495,916,762,934,907,830,931,741,582,528,410,154,126
4050 DATA 7729,708,254,210,214,209,701,655,701,484,603,488,593,791,258,304,255,301
4215 DATA 9041,689,178,10,708,348,826,129,727,321,828,770,937,883,722,120,420,425
4330 DATA 7304,942,503,823,942,692,283,73,117,175,118,186,100,169,103,595,770,713
4473 DATA 9571,93,853,957,97,710,143,585,839,496,939,733,753,191,591,351,903,337
4530 DATA 9092,189$5,552,736,179,687,709,357,835,392,785,972,895,306,34,900,509
4650 DATA 7582,980,806,193,177,707,832,635,715,649,652,7,312,157,341,86,328,5
8110 DATA 8670,208,136,2,97,572,827,471,562,771,564,633,566,983,173,660,936,509
10190 DATA 7457,404,306,673,621,24,399,402,232,225,132,224,530,878,26,681,990,710
10520 DATA 7454,192,194,482,485,991,893,169,897,788,32,167,175,126,180,564,874,245
10810 DATA 9096,159,411,986,991,996,40,37,941,471,554,787,32,23,851,645,741,431
15150 DATA 9382,428,409,37,587,35,722,483,476,438,842,482,484,447,922,924,949,717
15285 DATA 8094,47,798,781,144,990,170,238,152,221,155,647,877,721,442,440,634,637
15550 DATA 9193,678,681,46,442,637,631,634,677,43,439,634,636,639,642,924,634,176
15740 DATA 4563,37,76,45,78,52,84,472,30,266,716,959,14,50,548,445,637,54
15855 DATA 8258,552,447,624,58,556,450,701,53,560,450,520,609,526,526,531,536,559
16005 DATA 11877,518,859,704,722,706,402,749,990,500,310,987,768,989,631,394,871,777
18010 DATA 8170,323,928,38,926,234,636,880,38,567,430,31,231,748,878,36,533,713
18200 DATA 6480,499,856,564,568,139,4,228,701,883,44,987,71,170,238,152,221,155
18360 DATA 9049,29,195,313,3,802,763,927,537,535,570,412,137,998,45,976,894,913
20030 DATA 2591,803,38,866,884