--- title: "Britain Invaded!" id: 50652 type: "computer_media" slug: "britain-invaded" url: "http://localhost/computer_media/britain-invaded/" markdown_url: "http://localhost/computer_media/britain-invaded.md" published_at: "2023-06-25T08:24:11+00:00" modified_at: "2026-03-30T21:29:17+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2022/03/Britain-Invaded-1.png" excerpt: "Fight the hypothetical 1940 German invasion of Britain in this detailed turn-based wargame, featuring machine-code map data, scrolling terrain, and dice-driven combat resolution." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "Sharp's" slug: "sharps" taxonomy: "post_tag" url: "http://localhost/tag/sharps/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" genre: - name: "Strategy" slug: "strategy" taxonomy: "genre" url: "http://localhost/type/strategy/" media_type: "Program" download_url: "https://archive.org/download/timex-sinclair-software-archive/Britain%20Invaded%21%20%281985%29%28Sharp%27s%29%28TS2068%29%28US%29%28Program%29.zip" mediadate: "1985" producer_company: - id: 11276 title: "Sharp’s" type: "company" url: "http://localhost/company/sharps/" related_products: - id: 11984 title: "Britain Invaded!" type: "product" url: "http://localhost/product/britain-invaded/" media_type_tags: "Strategy" --- This is a turn-based wargame simulating Operation Sea Lion — the hypothetical 1940 German invasion of Britain. The program uses machine code loaded from a separate CODE block at address 60000 (5,536 bytes), which stores the map data; BASIC then reads and writes this memory directly using PEEK and POKE to track unit positions and terrain. Units are represented as single inverse-video characters on a scrolling viewport (22×32 cells of a larger 34×44 map), with German forces (G=Guards, P=Panzer, M=Motorized) attacking British units (T=Tank, I=Infantry, B=Brigade) across a channel modeled with weather effects. Combat resolution uses a dice roll modified by a strength ratio, with results ranging from attacker/defender destruction to retreat, and a 15-turn game cycle determines victory by comparing surviving force ratios and London’s occupation status. *** ## Program Analysis ### Program Structure The program is organized into several functional regions separated by line number ranges. Line `1` saves both the BASIC loader and the machine code block; line `2` is the true entry point, loading the CODE block and initializing the display. The main game loop runs from turn 1 to 15, controlled by the variable `t`, iterating through German movement (lines 1000–1999), British movement (lines 7000–7130), combat resolution (lines 6000–6700), and inter-turn bookkeeping (lines 5800–5999). - Lines 1–4: Boot, initialization, first-turn setup - Lines 100–131: Viewport scroll subroutines (up/down/left/right) - Lines 150–211: Viewport render dispatch and map display via `LIST USR 62000` - Lines 212–237: Unit overlay rendering (British and German) - Lines 250–327: First-turn German order-of-battle generation - Lines 400–415, 600–611: Viewport centering on a unit - Lines 450–460, 700–710: Terrain-character restore after unit moves - Lines 500–511: German unit display pass - Lines 1000–2050: German player movement phase with keyboard input - Lines 3000–3011: Paper-color zone lookup (POKE to system variables for color) - Lines 4000–4515: German AI movement - Lines 5700–5999: Turn-end scoring, weather, reinforcement, victory check - Lines 6000–6700: German-initiated combat resolution - Lines 7000–7130: British-initiated combat resolution - Lines 8000–8019: Error/invalid-move flash animation and ON ERR handler ### Machine Code Usage A 5,536-byte machine code block is loaded at address 60000. This block stores the entire scrolling map as character data (terrain tiles encoded as character values 144–150). The map is 34 rows × 44 columns, and any cell’s address is computed with the formula `60000 + (row * 44) + col - 45`, used repeatedly throughout the program. The machine code routine at address 62000 is invoked via `LIST USR 62000` at line 211 to render the visible viewport directly to the screen without BASIC overhead. A 20-entry transport/port table at address 61501 (3 bytes per entry: row, column, active-flag) tracks German landing craft. Addresses 61498–61500 are used as parameters passed into the machine code (current viewport top-left and column-width). ### Map Coordinate System The full map is 34 rows × 44 columns. The visible viewport is 22 rows × 32 columns. The top-left corner of the viewport is stored in `x` (row) and `y` (column). Screen positions are computed as `AT e(r)-x, f(r)-y` for German units and `AT c(p)-x, d(p)-y` for British units. The subroutine at line 3000 maps a row number `zz` to a paper color zone by POKEing system variables 23675–23676 to select the appropriate color area — this corresponds to geographic zones (coast, sea, inland). ### Unit Data Arrays | Array | Size | Usage | | --- | --- | --- | | `b()` | 40 | British unit type (2=Tank, 3=Infantry, 5=Brigade; 0=empty) | | `c()`, `d()` | 40 | British unit row and column position | | `g()` | 40 | German unit type (3=Panzer, 4=Motorized, 6=Guards; 0=empty) | | `e()`, `f()` | 40 | German unit row and column position | | `a$()` | 34×44 | Occupancy map: “0”=empty, “1”=German, “2”=British, “3”=blocked | | `d$()` | 34×44 | Attack direction encoding for British fire phase | | `j$()` | 40 | German unit activation flag (“0″=inactive, “1”=active) | ### Combat Resolution Combat uses a strength-ratio-plus-dice system. The attacker’s type value and the defender’s type value are compared; terrain modifiers are applied (character code 148 adds 3, code 149 adds 1 to the defender’s effective strength). A D6 roll is added to the ratio: results above 10 destroy the defender, 8–10 destroy both, 6–7 cause the attacker to advance, 3–5 cause a retreat, and 1–2 destroy the attacker. The subroutine at line 6205 handles the actual resolution and is shared between both the German attack phase (line 6150) and the British counter-attack phase (line 7115), with `nn` distinguishing attacker identity and `am`/`dm` holding the relevant terrain-restore subroutine addresses as numeric values passed to `GO SUB`. ### Key BASIC Idioms and Techniques - `ON ERR GO TO` is used extensively (lines 1006, 1045, 1063, 4001, 5946, 6009) as a guard against out-of-bounds array accesses, effectively making many boundary checks optional — a pragmatic technique to simplify edge cases. - `LIST USR 62000` at line 211 is an unconventional use of `LIST` to call a machine code routine that renders the map viewport, exploiting the fact that `USR` returns an integer which `LIST` ignores after execution. - The `GO SUB am` and `GO SUB dm` calls at line 6151 pass subroutine addresses (450 or 700) as numeric variables, allowing the combat routine to call either the German or British terrain-restore function depending on who is attacking. - The string array `a$` is used as a 2D occupancy grid with character comparisons rather than a numeric array, saving memory. - Random activation of German units uses `INT(RND*10)+1` compared against `pp` (3 early-game, 10 later), providing a graduated activation probability. - SOUND at line 6219 plays a combat sound effect with multiple voice parameters before the resolution display. ### German AI Movement The AI movement routine (lines 4000–4515) drives each German unit toward its assigned target position (`c(r)`, `d(r)`), with units entering from French ports on the south-east edge of the map. Movement preference is determined by comparing target and current coordinates: horizontal movement is attempted first if the column difference is larger, vertical otherwise. The helper subroutines at 4200 (column movement) and 4500 (row movement) each check occupancy in `a$()` and terrain character codes before committing a move, and increment a move counter `n` against a per-unit movement allowance `m`. Units positioned near London (row ≥ 28, column < 33) switch to a special path-finding branch at line 4031. ### Reinforcement and Victory British reinforcements are scripted by turn number at lines 5960–5995: Infantry (`b()=3`) is added on turns 1, 3, 4, 5; Brigade (`b()=5`) on turns 3, 5, 6, 9; Tank (`b()=2`) on turns 2, 10, 11; doubled quantities on turns 7 and 11. All reinforcements enter at row 3, column 13 (southern England). German reinforcements arrive via the port table at 61510 when weather (`we`) and the remaining reinforcement quota (`gr`) allow. The game ends with a German victory if the force ratio ≥ 1, with a special “London Falls” message if the 2×2 grid around London (rows 18–19, columns 26–27) is occupied by two or more German units. ### Anomalies and Notable Points - Line 5701 is targeted by the GOTO at line 5948 but does not exist in the listing; execution would fall through to line 5702, which is the victory check — this is likely intentional shorthand rather than a bug. - Lines 303–327 contain unreachable code: the loop at line 302 immediately jumps to line 324 via `GO TO 324`, so lines 305–309 (which set up alternative loop ranges for the other two groups) are only ever reached via the `NEXT i`/`GO TO` cascade — a non-obvious control structure that handles three separate index ranges (1–18, 19–32, 33–40) for the port-table initialization. - Line 5985 ends with a trailing colon after `NEXT a`, which is syntactically harmless but unusual. - The double-colon `LET w=j:: LET u=k-1` at lines 7051–7058 is a syntactic artifact — the extra colon is treated as an empty statement separator and does not affect execution. ## Source Code ``` 1 SAVE "war" LINE 2: SAVE "mc"CODE 60000,5536: STOP 2 ON ERR GO TO 8019: CLS : PRINT AT 10,8;"BRITIAN INVADED!": PRINT AT 12,10;"\*1984 Sharp's": LOAD ""CODE : POKE 23730,95: POKE 23731,234: RANDOMIZE 0: PAUSE (RND*30): LET x=11: LET y=12: BORDER 0: PAPER 6 3 DELETE ,2: BORDER 0: GO SUB 150: FOR t=1 TO 15: IF t=1 THEN GO TO 250 4 LET x=99: GO TO 1000 100 LET x=x+s: IF x>13 THEN LET x=13 101 GO TO 150 110 LET x=x-s: IF x<1 THEN LET x=1 111 GO TO 150 120 LET y=y+s: IF y>12 THEN LET y=12 121 GO TO 150 130 LET y=y-s: IF y<1 THEN LET y=1 131 GO TO 150 150 IF x<4 THEN POKE 23675,88: POKE 23676,255: GO TO 200 152 IF x<9 THEN POKE 23675,176: POKE 23676,254: GO TO 200 154 IF x<15 THEN POKE 23675,8: POKE 23676,254: GO TO 200 200 LET z=60000+((x*44)+y)-45 202 POKE 61499,INT (z/256): LET z1=INT (z/256) 204 POKE 61500,(z-((INT z1)*256)) 206 POKE 61498,x 207 LET v=61501 209 INVERSE 0 210 POKE 63682,x+22 211 CLS : LIST USR 62000 212 POKE 23675,88: POKE 23676,255: FOR a=1 TO 20 213 LET b=PEEK v: LET c=PEEK (v+1): LET d=PEEK (v+2) 215 IF d=1 THEN LET d=1: IF b>=x AND b<=x+21 AND c>=y AND c<=y+31 THEN PAPER 6: INK 0: PRINT AT b-x,c-y;"\b" 216 LET v=v+3 217 NEXT a 219 INK 2: INVERSE 1: FOR z=1 TO 40 220 IF b(z)=0 THEN NEXT z: GO TO 230 221 IF b(z)=2 THEN LET b$="T" 222 IF b(z)=3 THEN LET b$="I" 223 IF b(z)=5 THEN LET b$="B" 225 IF b(z)>0 AND c(z)>=x AND x+21>=c(z) AND y<=d(z) AND y+31>=d(z) THEN PRINT AT c(z)-x,d(z)-y;b$ 226 IF t=1 THEN LET a$(c(z)+1,d(z)+1)="2" 227 NEXT z 230 INVERSE 1: INK 0: FOR z=1 TO 40 231 IF g(z)=0 THEN NEXT z: RETURN 232 IF g(z)=6 THEN LET g$="G" 233 IF g(z)=3 THEN LET g$="P" 234 IF g(z)=4 THEN LET g$="M" 235 IF x<=e(z) AND x+21>=e(z) AND y<=f(z) AND y+31>=f(z) THEN PRINT AT e(z)-x,f(z)-y;g$ 236 IF t=1 THEN LET a$(e(z)+1,f(z)+1)="1" 237 NEXT z: RETURN 250 LET z1=1: LET z2=19: LET z3=33 252 FOR a=1 TO 18 253 LET k=INT (RND*10)+1 255 LET h=INT (RND*100)+1 256 IF h<45 THEN GO TO 260 257 IF h<85 THEN GO TO 270 258 GO TO 280 260 IF k>7 THEN LET g(z1)=3: LET z1=z1+1: NEXT a: GO TO 300 265 LET g(z1)=6: LET z1=z1+1: NEXT a: GO TO 300 270 IF k>7 THEN LET g(z2)=3: LET z2=z2+1: NEXT a: GO TO 300 275 LET g(z2)=6: LET z2=z2+1: NEXT a: GO TO 300 280 IF k>7 THEN LET g(z3)=3: LET z3=z3+1: NEXT a: GO TO 300 285 LET g(z3)=6: LET z3=z3+1: NEXT a: GO TO 300 300 LET m=61501 302 FOR i=33 TO 40 303 GO TO 324 305 LET m=61513 306 FOR i=1 TO 18: GO TO 324 307 LET m=61537 308 FOR i=19 TO 32: IF m>61559 THEN LET m=61537 309 GO TO 324 324 IF g(i)>0 THEN LET e(i)=PEEK m: LET f(i)=PEEK (m+1): POKE m+2,1: LET m=m+3: LET a$(e(i)+1,f(i)+1)="1": NEXT i 325 NEXT i: IF i>=40 THEN GO TO 305 326 IF i>=32 THEN GO TO 500 327 GO TO 307 400 IF x=1 AND c(p)<20 AND yd(p) THEN RETURN 401 IF y=1 AND xc(p) THEN RETURN 402 IF xc(p) AND yd(p) THEN RETURN 403 IF x=1 AND y=1 AND c(p)<20 AND d(p)<30 THEN RETURN 410 LET x=c(p)-10: LET y=d(p)-10 411 IF x<1 THEN LET x=1 412 IF y<1 THEN LET y=1 413 IF x>13 THEN LET x=13 414 IF y>12 THEN LET y=12 415 GO SUB 150: RETURN 450 INVERSE 0: INK 1: PAPER 6: LET spot=60000+(e(r)*44)+f(r)-45: IF PEEK spot=150 THEN INK 3 452 IF 143=e(p) AND y<=f(p) AND y+31>=f(p) THEN PRINT AT e(p)-x,f(p)-y;g$ 511 NEXT p: GO TO 6000 600 IF x=1 AND e(r)<21 AND yf(r) THEN RETURN 601 IF y=1 AND xe(r) THEN RETURN 602 IF xe(r) AND yf(r) THEN RETURN 603 IF x=1 AND y=1 AND e(r)<20 AND f(r)<30 THEN RETURN 610 LET x=e(r)-10: LET y=f(r)-10 611 GO TO 411 700 LET zz=c(p): GO SUB 3000: INVERSE 0: INK 1: PAPER 6: LET spot=60000+(c(p)*44)+d(p)-45: IF PEEK spot=150 THEN INK 3 702 IF 143=5 THEN LET pp=10 1005 FOR p=1 TO 40 1006 ON ERR GO TO 1008 1008 IF b(p)=0 THEN NEXT p: GO TO 7000 1010 LET m=5: IF b(p)=5 OR b(p)=3 THEN LET m=3 1012 LET tm=INT (RND*10)+1 1015 IF j$(p)="0" AND tm<=pp THEN LET j$(p)="1" 1017 IF j$(p)="0" THEN NEXT p: GO TO 7000 1020 IF x>=c(p) OR x+21<=c(p) OR y>=d(p) OR y+31<=d(p) THEN GO SUB 400 1022 IF b(p)=5 THEN LET q$="B" 1024 IF b(p)=2 THEN LET q$="T" 1026 IF b(p)=3 THEN LET q$="I" 1028 FOR n=1 TO m 1030 IF a$(c(p)+1,d(p)+2)="1" OR a$(c(p),d(p)+1)="1" OR a$(c(p),d(p)+2)="1" OR a$(c(p)+1,d(p))="1" OR a$(c(p)+2,d(p))="1" OR a$(c(p)+2,d(p)+1)="1" OR a$(c(p)+2,d(p)+2)="1" OR a$(c(p),d(p))="1" THEN GO TO 2000 1033 LET spot=60000+(c(p)*44)+d(p)-45 1034 IF x>=c(p) OR x+21<=c(p) OR y>=d(p) OR y+31<=d(p) THEN GO SUB 400 1035 INVERSE 1: FLASH 1: INK 2: PRINT AT c(p)-x,d(p)-y;q$: FLASH 0 1036 IF PEEK spot<>147 THEN GO TO 1040 1037 LET k=61498: FOR l=1 TO 20 1038 IF PEEK (k+(l*3))=c(p) AND PEEK (k+(l*3)+1)=d(p) AND PEEK (k+(l*3)+2)=1 THEN POKE (k+(l*3)+2),0: GO TO 1050 1039 NEXT l 1040 IF PEEK spot=150 OR PEEK spot=147 THEN INK 3: FLASH 1: PRINT AT c(p)-x,d(p)-y;q$: FLASH 0 1042 LET zz=c(p): GO SUB 3000 1045 ON ERR GO TO 1048 1047 FOR k=1 TO 20 1048 IF INKEY$="l" THEN PAUSE 5: INPUT s: GO SUB 130: GO SUB 8018 1049 IF INKEY$="d" THEN PAUSE 5: INPUT s: GO SUB 100: GO SUB 8018 1050 IF INKEY$="u" THEN PAUSE 5: INPUT s: GO SUB 110: GO SUB 8018 1051 IF INKEY$="r" THEN PAUSE 5: INPUT s: GO SUB 120: GO SUB 8018 1052 IF INKEY$="e" OR INKEY$="E" THEN GO TO 1060 1054 IF INKEY$="5" THEN GO TO 1100 1055 IF INKEY$="6" THEN GO TO 1200 1056 IF INKEY$="7" THEN GO TO 1300 1057 IF INKEY$="8" THEN GO TO 1400 1058 IF INKEY$="9" THEN INVERSE 1: INK 2: PRINT AT c(p)-x,d(p)-y;q$: NEXT p: GO TO 7000 1059 GO TO 1048 1060 IF n>1 THEN GO TO 8000 1061 IF (144>PEEK spot OR PEEK spot>147) AND PEEK spot<>150 THEN GO TO 8000 1062 INK 2: INVERSE 1: FLASH 1: PRINT AT c(p)-x,d(p)-y;"E": FLASH 0 1063 ON ERR GO TO 1065 1064 FOR i=1 TO 10 1065 IF x>=c(p) OR x+21<=c(p) OR y>=d(p) OR y+31<=d(p) THEN GO SUB 400: LET zz=c(p): GO SUB 3000: FLASH 1: INK 2: INVERSE 1: PRINT AT c(p)-x,d(p)-y;"E": FLASH 0 1066 IF INKEY$="5" THEN GO TO 1075 1067 IF INKEY$="7" THEN GO TO 1600 1068 IF INKEY$="6" THEN GO TO 1085 1069 IF INKEY$="8" THEN GO TO 1610 1070 IF INKEY$="9" THEN GO TO 1620 1071 GO TO 1066 1075 IF a$(c(p)+1,d(p))<>"0" THEN GO TO 8010 1076 IF (144>PEEK (spot-1) OR PEEK (spot-1)>147) AND PEEK (spot-1)<>150 THEN GO TO 8010 1077 GO SUB 700: LET spot=spot-1: LET a$(c(p)+1,d(p)+1)="0": LET d(p)=d(p)-1 1078 GO TO 1630 1085 IF a$(c(p)+2,d(p)+1)<>"0" THEN GO TO 8010 1086 IF (144>PEEK (spot+44) OR PEEK (spot+44)>147) AND PEEK (spot+44)<>150 THEN GO TO 8010 1087 GO SUB 700: LET a$(c(p)+1,d(p)+1)="0": LET c(p)=c(p)+1: LET spot=spot+44: GO TO 1630 1100 IF d(p)<=1 OR a$(c(p)+1,d(p))="3" THEN GO TO 8000 1103 IF ((m=5 AND n>4) OR (m=3 AND n>2)) AND (PEEK (spot-1)=148 OR PEEK (spot-1)=149) THEN GO TO 8000 1105 GO SUB 700: INVERSE 1: INK 2: LET a$(c(p)+1,d(p)+1)="0" 1107 IF (PEEK (spot-1)=189 OR PEEK (spot-1)=148) THEN LET n=n+1 1109 LET d(p)=d(p)-1: LET spot=spot-1: PRINT AT c(p)-x,d(p)-y;q$: BEEP .2,-7: LET a$(c(p)+1,d(p)+1)="2": NEXT n: GO TO 2000 1200 IF c(p)>33 OR a$(c(p)+2,d(p)+1)="3" THEN GO TO 8000 1202 IF ((m=5 AND n>4) OR m=3 AND n>2) AND (PEEK (spot+44)=148 OR PEEK (spot+44)=149) THEN GO TO 8000 1204 GO SUB 700: INVERSE 1: INK 2: LET a$(c(p)+1,d(p)+1)="0" 1206 IF (PEEK (spot+44)=148 OR PEEK (spot+44)=149) THEN LET n=n+1 1208 LET c(p)=c(p)+1: LET spot=spot+44: GO SUB 3000: PRINT AT c(p)-x,d(p)-y;q$: BEEP .2,-7: LET a$(c(p)+1,d(p)+1)="2": NEXT n: GO TO 2000 1300 IF c(p)<=1 OR a$(c(p),d(p)+1)="3" THEN GO TO 8000 1303 IF ((m=5 AND n>4) OR (m=3 AND n>2)) AND (PEEK (spot-44)=148 OR PEEK (spot-44)=149) THEN GO TO 8000 1305 GO SUB 700: INVERSE 1: INK 2: LET a$(c(p)+1,d(p)+1)="0" 1307 IF (PEEK (spot-44)=148 OR PEEK (spot-44)=149) THEN LET n=n+1 1310 LET c(p)=c(p)-1 1312 LET spot=spot-44: GO SUB 3000: PRINT AT c(p)-x,d(p)-y;q$: BEEP .2,-7: LET a$(c(p)+1,d(p)+1)="2": NEXT n: GO TO 2000 1400 IF d(p)>42 OR a$(c(p)+1,d(p)+2)="3" THEN GO TO 8000 1402 IF ((m=5 AND n>4) OR (m=3 AND n>2)) AND (PEEK (spot+1)=148 OR PEEK (spot+1)=149) THEN GO TO 8000 1404 GO SUB 700: INVERSE 1: INK 2: LET a$(c(p)+1,d(p)+1)="0" 1406 IF (PEEK (spot+1)=148 OR PEEK (spot+1)=149) THEN LET n=n+1 1408 LET d(p)=d(p)+1: LET spot=spot+1: PRINT AT c(p)-x,d(p)-y;q$: BEEP .2,-7: LET a$(c(p)+1,d(p)+1)="2": NEXT n: GO TO 2000 1600 IF a$(c(p),d(p)+1)<>"0" THEN GO TO 8010 1601 IF (143>PEEK (spot-44) OR PEEK (spot-44)>147) AND PEEK (spot-44)<>150 THEN GO TO 8010 1602 GO SUB 700: LET spot=spot-44: LET a$(c(p)+1,d(p)+1)="0": LET c(p)=c(p)-1: GO TO 1630 1610 IF a$(c(p)+1,d(p)+2)<>"0" THEN GO TO 8010 1611 IF (144>PEEK (spot+1) OR PEEK (spot+1)>147) AND PEEK (spot+1)<>150 THEN GO TO 8010 1612 GO SUB 700: LET spot=spot+1: LET a$(c(p)+1,d(p)+1)="0": LET d(p)=d(p)+1 1613 GO TO 1630 1620 INK 2: INVERSE 1: PRINT AT c(p)-x,d(p)-y;q$: NEXT p: GO TO 7000 1630 BEEP .2,0: LET a$(c(p)+1,d(p)+1)="2": INVERSE 1: INK 2: FLASH 1: PRINT AT c(p)-x,d(p)-y;"E": FLASH 0 1631 IF a$(c(p)+1,d(p)+2)="1" OR a$(c(p),d(p)+1)="1" OR a$(c(p),d(p)+2)="1" OR a$(c(p)+1,d(p))="1" OR a$(c(p)+2,d(p))="1" OR a$(c(p)+2,d(p)+1)="1" OR a$(c(p)+2,d(p)+2)="1" OR a$(c(p),d(p))="1" THEN INK 2: INVERSE 1: PRINT AT c(p)-x,d(p)-y;q$: NEXT p: GO TO 7000 1634 LET zz=c(p): GO SUB 3000: NEXT i: INVERSE 1: INK 2: PRINT AT c(p)-x,d(p)-y;q$: NEXT p: GO TO 7000 2000 INVERSE 1: INK 2 2001 IF a$(c(p)+1,d(p)+2)="1" OR a$(c(p),d(p)+1)="1" OR a$(c(p),d(p)+2)="1" OR a$(c(p)+1,d(p))="1" OR a$(c(p)+2,d(p))="1" OR a$(c(p)+2,d(p)+1)="1" OR a$(c(p)+2,d(p)+2)="1" OR a$(c(p),d(p))="1" THEN GO TO 2010 2004 NEXT p: GO TO 7000 2010 FLASH 1: PRINT AT c(p)-x,d(p)-y;"A": FLASH 0 2011 IF INKEY$="n" OR INKEY$="N" THEN PRINT AT c(p)-x,d(p)-y;q$: NEXT p: GO TO 7000 2012 IF INKEY$="y" OR INKEY$="Y" THEN GO TO 2015 2013 GO TO 2010 2015 INK 2: FLASH 1: PRINT AT c(p)-x,d(p)-y;"A": FLASH 0: INPUT u 2020 IF u=1 AND a$(c(p),d(p))="1" THEN LET d$(c(p),d(p))="1": GO TO 2050 2021 IF u=2 AND a$(c(p),d(p)+1)="1" THEN LET d$(c(p),d(p))="2": GO TO 2050 2022 IF u=3 AND a$(c(p),d(p)+2)="1" THEN LET d$(c(p),d(p))="3": GO TO 2050 2024 IF u=4 AND a$(c(p)+1,d(p))="1" THEN LET d$(c(p),d(p))="4": GO TO 2050 2025 IF u=5 AND a$(c(p)+1,d(p)+2)="1" THEN LET d$(c(p),d(p))="5": GO TO 2050 2026 IF u=6 AND a$(c(p)+2,d(p))="1" THEN LET d$(c(p),d(p))="6": GO TO 2050 2027 IF u=7 AND a$(c(p)+2,d(p)+1)="1" THEN LET d$(c(p),d(p))="7": GO TO 2050 2028 IF u=8 AND a$(c(p)+2,d(p)+2)="1" THEN LET d$(c(p),d(p))="8": GO TO 2050 2030 FOR h=1 TO 4 2032 INVERSE 0: PAUSE 7: PRINT AT c(p)-x,d(p)-y;"X": PAUSE 7: PRINT AT c(p)-x,d(p)-y;" ": NEXT h 2033 GO TO 2010 2050 INVERSE 1: INK 2: PRINT AT c(p)-x,d(p)-y;q$: LET kk=1: NEXT p: GO TO 7000 3000 IF zz<4 THEN POKE 23675,88: POKE 23676,255: RETURN 3001 IF zz<9 THEN POKE 23675,176: POKE 23676,254: RETURN 3002 IF zz<15 THEN POKE 23675,8: POKE 23676,254: RETURN 3003 IF zz=19 THEN POKE 23675,184: POKE 23676,252: RETURN 3004 IF zz<19 THEN POKE 23675,96: POKE 23676,253: RETURN 3005 IF zz=20 THEN POKE 23675,16: POKE 23676,252: RETURN 3006 IF zz=21 THEN POKE 23675,104: POKE 23676,251: RETURN 3007 IF zz<29 THEN POKE 23675,192: POKE 23676,250: RETURN 3008 IF zz=29 THEN POKE 23675,24: POKE 23676,250: RETURN 3009 IF zz=30 THEN POKE 23675,112: POKE 23676,249: RETURN 3010 IF zz>30 THEN POKE 23675,200: POKE 23676,248: RETURN 3011 RETURN 4000 BORDER 0: FOR r=1 TO 40 4001 ON ERR GO TO 4002 4002 IF g(r)=0 THEN NEXT r: GO TO 6000 4003 LET spot=60000+(e(r)*44)+f(r)-45 4004 LET m=4: LET n=0 4005 IF g(r)=3 THEN LET m=6 4006 IF PEEK spot<>147 THEN GO TO 4010 4007 LET k=61498: FOR l=1 TO 20 4008 IF t>1 AND PEEK (k+(l*3))=e(r) AND PEEK (k+(l*3)+1)=f(r) AND PEEK (k+(l*3)+2)=0 THEN POKE (k+(l*3)+2),1: GO TO 4010 4009 NEXT l 4010 IF a$(e(r),f(r))="2" OR a$(e(r),f(r)+1)="2" OR a$(e(r),f(r)+2)="2" OR a$(e(r)+1,f(r))="2" OR a$(e(r)+1,f(r)+2)="2" OR a$(e(r)+2,f(r))="2" OR a$(e(r)+2,f(r)+1)="2" OR a$(e(r)+2,f(r)+2)="2" THEN NEXT r: GO TO 6000 4012 IF x>=e(r) OR x+20=f(r) OR y+30m THEN NEXT r: GO TO 6000 4028 IF e(r)>=28 AND f(r)<33 THEN GO TO 4031 4029 IF d(r)>f(r)+2 THEN GO TO 4130 4030 IF d(r)e(r)+2 THEN GO TO 4100 4034 IF c(r)>e(r) THEN GO TO 4100 4035 IF c(r)f(r) THEN GO TO 4130 4037 IF d(r)f(r) THEN LET z1=0: GO SUB 4200 4103 IF d(r)e(r) THEN LET z1=1: GO SUB 4500 4122 IF c(r)m THEN LET z5=5: RETURN 4204 IF z1=0 AND a$(e(r)+1,f(r))<>"0" THEN RETURN 4205 IF z1=1 AND a$(e(r)+1,f(r)+2)<>"0" THEN RETURN 4208 IF z1=0 AND (147m THEN LET z5=5: RETURN 4503 IF z1=0 AND a$(e(r),f(r)+1)<>"0" THEN RETURN 4504 IF z1=1 AND a$(e(r)+2,f(r)+1)<>"0" THEN RETURN 4507 IF z1=0 AND (147=1 THEN INK 0: FLASH 1: PRINT AT 10,7;"GERMAN VICTORY": FLASH 0: STOP 5704 FLASH 1: INK 0: PRINT AT 10,7;"BRITISH VICTORY": FLASH 0: STOP 5760 FLASH 1: INK 0: PRINT AT 10,2;"LONDON FALLS - GERMAN VICTORY": FLASH 0: STOP 5800 IF t=15 THEN GO TO 5700 5802 IF we=1 THEN LET gr=2 5804 IF we=2 THEN LET gr=1 5806 IF we=3 THEN LET gr=0 5808 IF gr=0 THEN GO TO 5700 5812 LET po=61510 5814 FOR v=1 TO 40 5820 IF g(v)=0 THEN GO TO 5829 5825 NEXT v: GO TO 5700 5827 IF gr=0 THEN GO TO 5700 5828 NEXT v 5829 LET rand=INT (RND*3)+1 5830 IF rand=1 THEN LET k=3 5831 IF rand=2 THEN LET k=4 5832 IF rand=3 THEN LET k=6 5835 FOR a=1 TO 16 5840 LET ab=PEEK (po+(a*3)): LET ac=PEEK (po+(a*3)+1): IF PEEK (po+(a*3)+2)=1 AND a$(ab+1,ac+1)="0" THEN LET g(v)=k: LET e(v)=ab: LET f(v)=ac: LET a$(ab+1,ac+1)="1": LET gr=gr-1: GO TO 5827 5841 NEXT a: GO TO 5700 5900 BORDER 5: CLS : LET we=INT (RND*3)+1 5901 LET port=0: LET british=0: LET german=0 5902 CLS : FOR l=1 TO 20 5904 IF PEEK (61500+(l*3))=1 THEN LET port=port+1 5906 NEXT l 5908 FOR z=1 TO 40 5910 IF g(z)>0 THEN LET german=german+1 5911 IF b(z)>0 THEN LET british=british+1 5912 NEXT z 5914 LET ratio=(german+port)/british 5915 IF we=1 THEN LET u$="CALM" 5916 IF we=2 THEN LET u$="ROUGH" 5917 IF we=3 THEN LET u$="SEVERE" 5918 LET d=0: FOR m=1 TO 2: FOR n=1 TO 2 5919 IF a$(18+m+1,26+n+1)="1" THEN LET d=d+1 5920 NEXT n: NEXT m: IF d>=2 THEN GO TO 5760 5924 INK 0: INVERSE 0: PRINT AT 1,10;"TURN# ";t 5925 PRINT AT 7,8;"GERMAN FORCES ";german 5928 PRINT AT 4,7;"CHANNEL WEATHER IS ";u$ 5930 PRINT AT 9,8;"GERMAN PORTS ";port 5935 PRINT AT 11,8;"BRITISH FORCES ";british 5940 PRINT AT 15,8;"RATIO ";ratio 5945 PRINT AT 20,8;"PUSH 'C' TO CONTINUE" 5946 ON ERR GO TO 5947 5947 IF INKEY$="c" OR INKEY$="C" THEN GO TO 5960 5948 IF t=15 THEN PAUSE 100: GO TO 5701 5949 GO TO 5947 5960 IF t=1 OR t=3 OR t=4 OR t=5 THEN LET bi=1 5962 IF t=3 OR t=5 OR t=6 OR t=9 THEN LET bb=1 5964 IF t=2 OR t=10 OR t=11 THEN LET bt=1 5966 IF t=7 OR t=11 THEN LET bb=2 5968 IF t=7 THEN LET bi=2 5969 IF bi>0 THEN GO TO 5975 5970 IF bb>0 THEN GO TO 5983 5971 IF bt>0 THEN GO TO 5990 5972 GO TO 5800 5975 FOR a=1 TO 40: IF b(a)=0 THEN GO TO 5977 5976 NEXT a: GO TO 5970 5977 LET b(a)=3: LET c(a)=3: LET d(a)=13: LET bi=bi-1: IF bi>0 THEN NEXT a 5978 GO TO 5970 5983 FOR a=1 TO 40: IF b(a)=0 THEN GO TO 5985 5984 NEXT a: GO TO 5971 5985 LET b(a)=5: LET c(a)=3: LET d(a)=13: LET bb=bb-1: IF bb>0 THEN NEXT a: 5986 GO TO 5971 5990 FOR a=1 TO 40: IF b(a)=0 THEN GO TO 5992 5991 NEXT a: GO TO 5972 5992 FOR a=1 TO 40: IF b(a)=0 THEN GO TO 5994 5993 NEXT a: GO TO 5972 5994 LET b(a)=2: LET c(a)=3: LET d(a)=13: LET bt=bt-1: IF bt>0 THEN NEXT a 5995 GO TO 5972 5999 STOP 6000 FOR a=1 TO 34 6001 LET d$(a)=e$ 6002 NEXT a 6008 BORDER 3: FOR r=1 TO 40: LET g2=0: IF g(r)=0 THEN NEXT r: GO TO 5900 6009 ON ERR GO TO 6015 6010 IF a$(e(r),f(r))="2" OR a$(e(r),f(r)+1)="2" OR a$(e(r),f(r)+2)="2" OR a$(e(r)+1,f(r))="2" OR a$(e(r)+1,f(r)+2)="2" OR a$(e(r)+2,f(r))="2" OR a$(e(r)+2,f(r)+1)="2" OR a$(e(r)+2,f(r)+2)="2" THEN GO TO 6020 6015 NEXT r: GO TO 5900 6020 IF a$(e(r),f(r))="2" THEN LET j=e(r)-1: LET k=f(r)-1: GO TO 6040 6021 IF a$(e(r),f(r)+1)="2" THEN LET j=e(r)-1: LET k=f(r): GO TO 6040 6022 IF a$(e(r),f(r)+2)="2" THEN LET j=e(r)-1: LET k=f(r)+1: GO TO 6040 6023 IF a$(e(r)+1,f(r)+2)="2" THEN LET j=e(r): LET k=f(r)+1: GO TO 6040 6024 IF a$(e(r)+1,f(r))="2" THEN LET j=e(r): LET k=f(r)-1: GO TO 6040 6025 IF a$(e(r)+2,f(r))="2" THEN LET j=e(r)+1: LET k=f(r)-1: GO TO 6040 6026 IF a$(e(r)+2,f(r)+1)="2" THEN LET j=e(r)+1: LET k=f(r): GO TO 6040 6027 IF a$(e(r)+2,f(r)+2)="2" THEN LET j=e(r)+1: LET k=f(r)+1: GO TO 6040 6028 NEXT r: GO TO 5900 6040 LET d$(e(r),f(r))="1" 6042 IF a$(j,k)="1" AND d$(j-1,k-1)<>"1" THEN LET w=j-1: LET u=k-1: GO TO 6080 6043 IF a$(j,k+1)="1" AND d$(j-1,k)<>"1" THEN LET w=j-1: LET u=k: GO TO 6080 6044 IF a$(j,k+2)="1" AND d$(j-1,k+1)<>"1" THEN LET w=j-1: LET u=k+1: GO TO 6080 6045 IF a$(j+1,k+2)="1" AND d$(j,k+1)<>"1" THEN LET w=j: LET u=k+1: GO TO 6080 6046 IF a$(j+1,k)="1" AND d$(j,k-1)<>"1" THEN LET w=j: LET u=k-1: GO TO 6080 6047 IF a$(j+2,k)="1" AND d$(j+1,k-1)<>"1" THEN LET w=j+1: LET u=k-1: GO TO 6080 6048 IF a$(j+2,k+1)="1" AND d$(j+1,k)<>"1" THEN LET w=j+1: LET u=k: GO TO 6080 6049 IF a$(j+2,k+2)="1" AND d$(j+1,k+1)<>"1" THEN LET w=j+1: LET u=k+1: GO TO 6080 6055 GO TO 6090 6080 LET g2=1: FOR m=1 TO 40 6082 IF e(m)=w AND f(m)=u AND g(m)>0 THEN LET d$(e(m),f(m))="1": GO TO 6090 6084 NEXT m: LET g2=0 6090 FOR p=1 TO 40 6092 IF c(p)=j AND d(p)=k AND b(p)>0 THEN GO TO 6100 6093 NEXT p: NEXT r: GO TO 5900 6100 LET tgs=g(r) 6102 IF g2=1 THEN LET tgs=g(r)+g(m) 6103 LET cha=INT (RND*2): IF cha=0 THEN NEXT r: GO TO 5900 6104 IF x>=e(r) OR x+18=f(r) OR y+2910 THEN GO TO 6250 6221 IF roll>7 THEN GO TO 6300 6222 IF roll>5 THEN GO TO 6400 6223 IF roll>2 AND nn=1 THEN LET nn=2: LET z$=b$: LET ink=2: LET at=b(p): LET df=g(r): LET am=700: LET dm=450: LET ax=c(p): LET ay=d(p): LET dx=e(r): LET dy=f(r): LET su=1: GO TO 6400 6224 IF roll>2 AND nn=2 THEN LET ink=0: LET nn=1: LET z$=g$: LET su=1: LET at=g(r): LET df=b(p): LET am=450: LET dm=700: LET ax=e(r): LET ay=f(r): LET dx=c(p): LET dy=d(p): GO TO 6400 6225 GO TO 6700 6250 LET df=0: LET a$(ax+1,ay+1)="0": LET zz=ax: GO SUB 3000: GO SUB am: LET ax=dx: LET ay=dy: LET a$(ax+1,ay+1)=STR$ nn: IF nn=1 THEN INK 0: INVERSE 1: PRINT AT ax-x,ay-y;g$: RETURN 6251 INK 2: INVERSE 1: PRINT AT ax-x,ay-y;b$: RETURN 6300 LET df=0: LET at=0: LET zz=ax: GO SUB 3000: GO SUB am: LET zz=dx: GO SUB 3000: GO SUB dm: LET a$(ax+1,ay+1)="0": LET a$(dx+1,dy+1)="0": RETURN 6400 LET mk=PEEK (60000+(dx*44)+dy-45): IF mk>150 OR mk=147 THEN LET df=0: LET a$(dx+1,dy+1)=STR$ nn: LET zz=ax: GO SUB 3000: GO SUB am: LET a$(ax+1,ay+1)="0": LET ax=dx: LET ay=dy: INVERSE 1: INK ink: PRINT AT ax-x,ay-y;z$: RETURN 6401 IF (a$(dx+1,dy)=STR$ nn AND a$(dx+1,dy+2)=STR$ nn) OR (a$(dx,dy+1)=STR$ nn AND a$(dx+2,dy+1)=STR$ nn) THEN LET df=0: LET a$(dx+1,dy+1)=STR$ nn: LET zz=ax: GO SUB 3000: GO SUB am: LET a$(ax+1,ay+1)="0": LET ax=dx: LET ay=dy: INVERSE 1: INK ink: PRINT AT ax-x,ay-y;z$: RETURN 6404 IF nn=2 AND roll>5 THEN GO TO 6430 6405 IF nn=2 AND roll<5.1 THEN GO TO 6430 6410 IF a$(c(p),d(p))="0" THEN LET a$(c(p),d(p))="2": LET zz=e(r): GO SUB 3000: GO SUB 450: LET a$(e(r)+1,f(r)+1)="0": LET ax=c(p): LET ay=d(p): LET e(r)=ax: LET f(r)=dy: LET c(p)=c(p)-1: LET d(p)=d(p)-1: LET dx=c(p): LET dy=d(p): LET a$(e(r)+1,f(r)+1)="1": INVERSE 1: INK 0: PRINT AT e(r)-x,f(r)-y;g$: INK 2: PRINT AT c(p)-x,d(p)-y;b$: RETURN 6413 IF a$(c(p)+1,d(p))="0" THEN LET a$(c(p)+1,d(p))="2": LET zz=e(r): GO SUB 3000: GO SUB 450: LET a$(e(r)+1,f(r)+1)="0": LET ax=c(p): LET ay=d(p): LET d(p)=d(p)-1: LET dx=c(p): LET dy=d(p): LET e(r)=ax: LET f(r)=ay: LET a$(e(r)+1,f(r)+1)="1": INVERSE 1: INK 0: PRINT AT e(r)-x,f(r)-y;g$: INK 2: PRINT AT c(p)-x,d(p)-y;b$: RETURN 6415 IF a$(c(p),d(p)+1)="0" THEN LET a$(c(p),d(p)+1)="2": LET zz=e(r): GO SUB 3000: GO SUB 450: LET a$(e(r)+1,f(r)+1)="0": LET e(r)=c(p): LET f(r)=d(p): LET ax=e(r): LET ay=f(r): LET c(p)=c(p)-1: LET a$(e(r)+1,f(r)+1)="1": INVERSE 1: INK 0: PRINT AT e(r)-x,f(r)-y;g$: INK 2: PRINT AT c(p)-x,d(p)-y;b$: RETURN 6420 LET a$(e(r)+1,f(r)+1)="0": LET b(p)=0: LET df=0: LET zz=e(r): GO SUB 3000: GO SUB 450: LET e(r)=c(p): LET f(r)=d(p): LET ax=e(r): LET ay=f(r): INVERSE 1: INK 0: PRINT AT e(r)-x,f(r)-y;g$ 6425 RETURN 6450 IF a$(e(r)+2,f(r)+2)="0" THEN LET a$(e(r)+2,f(r)+2)="1": LET zz=c(p): GO SUB 3000: GO SUB 700: LET a$(c(p)+1,d(p)+1)="0": LET c(p)=e(r): LET d(p)=f(r): LET e(r)=e(r)+1: LET f(r)=f(r)+1: LET ax=c(p): LET ay=d(p): LET dx=e(r): LET dy=f(r): LET a$(c(p)+1,d(p)+1)="2": INVERSE 1: INK 2: PRINT AT c(p)-x,d(p)-y;b$: INK 0: PRINT AT e(r)-x,f(r)-y;g$: RETURN 6451 IF a$(e(r)+2,f(r)+1)="0" THEN LET a$(e(r)+2,f(r)+1)="1": LET zz=c(p): GO SUB 3000: GO SUB 700: LET a$(c(p)+1,d(p)+1)="0": LET c(p)=e(r): LET d(p)=f(r): LET e(r)=e(r)+1: LET ax=c(p): LET ay=d(p): LET dx=e(r): LET dy=f(r): LET a$(c(p)+1,d(p)+1)="2": INVERSE 1: INK 2: PRINT AT c(p)-x,d(p)-y;b$: INK 0: PRINT AT e(r)-x,f(r)-y;g$: RETURN 6453 IF a$(e(r)+1,f(r)+2)="0" THEN LET a$(e(r)+1,f(r)+2)="1": LET zz=c(p): GO SUB 3000: GO SUB 700: LET a$(c(p)+1,d(p)+1)="0": LET c(p)=e(r): LET d(p)=f(r): LET f(r)=f(r)+1: LET ax=c(p): LET ay=d(p): LET dx=e(r): LET dy=f(r): LET a$(c(p)+1,d(p)+1)="2": INVERSE 1: INK 2: PRINT AT c(p)-x,d(p)-y;b$: INK 0: PRINT AT e(r)-x,f(r)-y;g$: RETURN 6460 LET g(r)=0: LET df=0: LET a$(e(r)+1,f(r)+1)="0": LET zz=e(r): GO SUB 3000: GO SUB 450: RETURN 6600 LET at=0: LET a$(ax+1,ay+1)="0": LET zz=ax: GO SUB 3000: GO SUB am: RETURN 6700 LET at=0: LET a$(ax+1,ay+1)=STR$ su: LET zz=dx: GO SUB 3000: GO SUB dm: LET a$(dx+1,dy+1)="0": LET dx=ax: LET dy=ay: INVERSE 1: INK 0: PRINT AT dx-x,dy-y;g$: RETURN 7000 IF kk=0 THEN GO TO 4000 7001 BORDER 3: LET kk=0: LET b2=0: LET bs2=0 7005 FOR p=1 TO 40 7006 LET b2=0: IF b(p)=0 THEN NEXT p: GO TO 4000 7010 IF d$(c(p),d(p))<>"0" THEN GO TO 7019 7015 NEXT p: GO TO 4000 7019 IF x+1>=c(p) OR x+19=d(p) OR y+290 THEN GO TO 7090 7084 NEXT m: LET b2=0 7090 FOR r=1 TO 40 7091 IF e(r)=j AND f(r)=k AND g(r)>0 THEN GO TO 7100 7094 NEXT r: NEXT p: GO TO 4000 7100 LET tas=b(p) 7101 IF b2=1 THEN LET tas=b(p)+b(m) 7105 IF x+1>=c(p) OR x+18=d(p) OR y+28