The War of the Shires

Date: 1986
Type: Program
Platform(s): ZX Spectrum
Tags: Game, Strategy

The War of the Shires is a real-time strategy game in which the player commands up to eleven named characters across a 32×22 tile map, recruiting armies, exploring shires, and battling an enemy force of darkness. Up to 70 enemy army units move autonomously each turn using a real-time action subroutine at line 100, with their positions tracked in a 70×5 array and tile occupancy maintained in a separate 22×32 integer array. Machine code routines are loaded from tape at addresses 60000 and 60474, handling map display and word-wrap text output respectively. Character attributes including army size, stamina, morale, and home coordinates are stored in a 12×9 two-dimensional array, while six DEF FN definitions at lines 1–6 perform string slicing using embedded length bytes to decode character names, shire names, terrain descriptions, and morale/vigor states. A secret tunnel mechanic and a victory condition tied to capturing the Keep of Darkness at map coordinates (2,13) add late-game objectives.


Program Analysis

Program Structure

The program is organized into clearly labeled subroutine blocks separated by REM statements. Execution begins at line 8000 on load, initializing arrays, loading external binary data, and then jumping to the character-select menu at line 5000. The main gameplay loop cycles through the options screen (line 500), movement (line 400), exploration (line 1000), and battle (line 2000). A real-time background routine at line 100 is called from within the keyboard-wait loop at line 20–25, giving enemy armies autonomous movement even while the player is deciding.

Data Encoding with Embedded Length Bytes

Six DEF FN definitions at lines 1–6 implement a compact string-slicing scheme. Each entry in f$() (character data) and p$() (terrain data) stores two length bytes at positions 1 and 2, followed by packed substrings. FN n$(x) extracts the character’s first name, FN s$(x) extracts the shire name, and FN f$(x) combines them as “Name of Shire”. Similarly, FN d$(x) and FN b$(x) decode terrain descriptions from p$(). At initialization (lines 8910, 8930) the length bytes are written using CHR$ x and CHR$ y read from DATA. This avoids fixed-width padding and saves memory.

Array Layout

ArrayDimensionsContents
a()12×9Character data: army size, stamina, morale, home x/y, current x/y, met-flag, provisions
u()70×5Enemy units: strength, morale, target character, x, y
t()22×32Tile occupancy totals (sum of enemy forces on each map cell)
m$()22×32Recruitment availability per tile (CHR$ codes encode recruit counts)
x$()22×32Map terrain tile characters, loaded from tape
f$()12×20Character name+shire strings with embedded length bytes
p$()10×20Terrain description strings with embedded length bytes
v$()10×21Vigor/morale state strings

Machine Code Usage

Two machine code blocks are loaded from tape at line 8000. The block at address 60000 (482 bytes, saved as “SHIRES prt”) provides the word-wrap print routine invoked as USR 60200 at line 30 — note the entry point is 200 bytes into the block, suggesting an internal dispatch table or data prefix. A second routine at USR 60474 is called once at line 8905 during initialization, likely setting up UDG characters or system variables. A third file “SHIRES udg” (commented out) would have loaded UDG bitmaps at USR "\a" (65368 on a 16K machine), 88 bytes covering 11 UDGs. Map display is triggered via USR 60000 stored in the throwaway variable m at line 46.

Real-Time Enemy AI

The subroutine at line 100 is called from within the player input loop (line 22), creating a pseudo-real-time effect. Each call increments a stamina recovery counter for one of the 12 characters (cycling n from 1 to 12), then picks a random enemy unit index m from 1–65. If the unit is alive, it moves one step toward its target character using signed arithmetic: +(ux<a(fk,4))-(ux>a(fk,4)). The t() occupancy array is updated atomically on each move. When an enemy reaches its target, combat is triggered either directly (line 125 branches to 2005 or 2000 depending on whether the target is the player’s current character).

Shire Mapping via DEF FN c()

The terrain-to-shire mapping at line 5 is a single compound boolean expression returning an integer 1–12. It partitions the 32×22 map into regions using nested AND/OR chains on the x and y coordinates, with each sub-expression contributing a unique integer value. This encodes the entire shire geography in one DEF FN with no lookup table. FN i(x) at line 6 similarly maps UDG character codes 144–151 to INK color indices for terrain rendering.

Combat Resolution

Battle at line 2005 computes attacker strength as INT(stamina² × morale / 62500), giving a nonlinear bonus for well-rested high-morale armies. Defender strength is INT(size × morale / 300). Losses are random in the range 1–100, biased by the superiority margin sup. Defending from a village tile (CHR$ 149, excluding the Keep at 13,2) doubles the attacker’s combat score. Morale (a(fk,3)) degrades by 50 on heavy losses and recovers by 50 on light losses, clamped to 0–248. Stamina always decreases by 50 per battle.

Movement and Terrain

Movement keys 5–8 map to the four cardinal directions. Line 455 blocks movement onto water (CHR$ 146) unless the character is already on a boat tile (CHR$ 152). Line 458 checks village tiles (CHR$ 152) for overcrowding — a village square can only hold one character. Line 460 blocks mountain tiles (CHR$ 144) unless FN n(char)=5, which evaluates to true when stamina is very low (the formula 5-INT(stamina/50) reaches 5 at stamina <50), meaning exhausted characters cannot enter mountains. Movement costs stamina: 5 points base, plus 5 on hills (CHR$ 145) and 3 on rough terrain (CHR$ 147 or CHR$ 151).

Tunnel Mechanic

A secret tunnel is revealed (line 1200) once the total enemy force drops below 15,000 men. The tunnel entrance is placed at a random y position (10 + 1–6) at a fixed x of 7, connecting to the western edge of the map at (4,13). The in flag tracks which side of the tunnel the character is on, and the teleport at line 1220 swaps positions bidirectionally.

Notable Idioms and Anomalies

  • VAL "number" is not used; instead, direct line numbers appear in GO TO and GO SUB.
  • PAUSE NOT PI at line 5026 evaluates NOT PI to 0, making PAUSE 0 — an indefinite pause until a key is pressed, used to suspend play.
  • Line 9100 duplicates the coordinate DATA from line 9070 identically, apparently a backup or cut-and-paste artifact that is never RESTOREd to.
  • The DATA at lines 9071–9080 contains two typos in string literals: “good sprits” (line 9077, missing ‘i’) and “very dispirated” (line 9079, misspelled), and line 6500 contains “deafeatd” in the defeat message.
  • DIM p(12) at line 1010 shadows the p$() string array with a numeric array of the same base name, which is legal in Spectrum BASIC since the sigil distinguishes them.
  • The recr variable at line 540 is set inside an IF chain but tested at line 564 unconditionally; if the IF code=149 branch was not taken, recr retains its value from a previous iteration, which could allow erroneous “Greet” options to appear.

Content

Appears On

Related Products

Related Articles

Related Content

Image Gallery

Source Code

    1 DEF FN n$(x)=f$(x,3 TO CODE f$(x,1)): DEF FN s$(x)=f$(x,CODE f$(x,1)+1 TO CODE f$(x,2)): DEF FN f$(x)=FN n$(x)+" of "+FN s$(x): REM                        by Alan Davis Z/X Computing     Nov.-Dec.-Jan. 85&86
    2 DEF FN d$(x)=p$(x,3 TO CODE p$(x,2)): DEF FN b$(x)=p$(x,CODE p$(x,1) TO CODE p$(x,2)): REM    GO Around To Meet Other Characters Visit Villages to Build Army
    3 DEF FN p()=INT ((32-LEN z$)/2): REM                            The KEEP OF DARKNESS is LEFT CENTER  You will find a Tunnel Through mountains by searching  in Mid-Game.
    4 DEF FN n(x)=5-INT (a(x,2)/50): DEF FN s(x)=10-INT (a(x,3)/50): DEF FN v$(x)=v$(FN n(x),2 TO CODE v$(FN n(x),1)): DEF FN q$(x)=v$(FN s(x),2 TO CODE v$(FN s(x),1)): DEF FN r(x)=1+INT (RND*x)
    5 DEF FN c(y,x)=(((x>8 AND x<20)+(2 AND x<9)+(3 AND x>19 AND x<28)+(4 AND x>27)) AND y>16)+(((5 AND x>21)+(12 AND x<8)+(x>7 AND x<22)) AND (y<17 AND y>11))+(((6 AND x>24)+(7 AND x>7 AND x<25)+(11 AND x<8)) AND (y<12 AND y>5))+(((11 AND x<8)+(10 AND x>7 AND x<16)+(8 AND x>15 AND x<25)+(9 AND x>24)) AND y<6)
    6 DEF FN i(x)=(x=144)+(2 AND x=148)+(3 AND x=149)+(4 AND (x=145 OR x=147 OR x=150 OR x=151))+(5 AND x=146)
    8 REM   SHORT SUBROUTINES        
    9 PRINT #1; PAPER 7; INK 1;AT 1,0,,AT 1,4; PAPER 6;"<<< ANY KEY TO CLEAR >>>": RETURN 
   10 BEEP .02,39: BEEP .02,40: RETURN 
   14 REM   Decorated Page Title  
   15 LET code=CODE x$(y,x): IF code=32 THEN LET code=153
   16 CLS : PRINT ': GO SUB 40
   17 LET z$=CHR$ code: FOR i=1 TO 5: LET z$=z$+z$: NEXT i: INK FN i(code): PAPER 6: PRINT AT 0,0;z$;AT 2,0;z$: PRINT AT 1,0;z$( TO 2);AT 1,30;z$( TO 2);AT 4,0;: INK 0: PAPER 7
   18 RETURN 
   19 REM   Keyboard INPUT        
   20 IF battle THEN RETURN 
   21 PAUSE 75: LET i$=INKEY$: IF i$<>"" THEN GO SUB 10
   22 GO SUB 100
   24 IF i$="" THEN GO TO 20
   25 RETURN 
   29 REM    Word Wrap            
   30 LET z$=z$+".": LET prt=USR 60200: RETURN 
   39 REM    Center String PRINT   
   40 PRINT TAB FN p();z$: RETURN 
   44 REM      PRINT map           
   45 IF battle THEN RETURN 
   46 LET armies=0: LET m=USR 60000: LET z$=FN f$(char): PRINT #1; PAPER 6;AT 0,0,,AT 0,0;TAB FN p();z$'"Move(5-8)  Armies(1)  Options(0)": PAPER 7: INK 8: PRINT AT a(char,5)-1,a(char,4)-1; OVER 1;" ": RETURN 
   49 REM    Display Armies        
   50 IF battle THEN RETURN 
   51 LET armies=1: INK 0: FOR i=1 TO 70: PRINT AT u(i,5)-1,u(i,4)-1;CHR$ 154 AND u(i,1): NEXT i
   52 BRIGHT 1: FOR i=1 TO 11: PRINT AT a(i,5)-1,a(i,4)-1;CHR$ 154 AND a(i,1): NEXT i: BRIGHT 0
   53 GO TO 9
   99 REM    REAL TIME ACTION      
  100 LET a(n,2)=a(n,2)+(5 AND a(n,2)<245): LET n=n+(n<12)-(11 AND n=12)
  102 LET m=FN r(65): IF NOT u(m,1) THEN RETURN 
  103 LET fk=u(m,3): IF NOT a(fk,1) THEN LET u(m,3)=FN r(11): RETURN 
  110 LET ux=u(m,4): LET uy=u(m,5): LET vx=ux+(ux<a(fk,4))-(ux>a(fk,4)): LET u(m,4)=vx: LET vy=uy+(uy<a(fk,5))-(uy>a(fk,5)): LET u(m,5)=vy
  115 LET t(uy,ux)=t(uy,ux)-u(m,1): LET t(vy,vx)=t(vy,vx)+u(m,1): IF armies THEN LET chr=CODE x$(uy,ux): PRINT INK 0;AT vy-1,vx-1;CHR$ 154;AT uy-1,ux-1; INK FN i(chr);x$(uy,ux) AND NOT t(uy,ux)
  120 IF vx<>a(fk,4) OR vy<>a(fk,5) THEN RETURN 
  122 IF armies THEN LET z$=FN n$(fk)+" is engaged in battle": PRINT #1; FLASH 1;AT 1,0,,AT 1,0;TAB FN p();z$: PRINT BRIGHT 1;AT vy-1,vx-1; OVER 1; INK 8; FLASH 1;" ";CHR$ 8;: PAUSE 300: PRINT BRIGHT 0; OVER 1; INK 8; PAPER 0;" ": GO SUB 9
  125 LET ind=1: GO TO 2005-(5 AND fk=char)
  399 REM     MOVEMENT             
  400 IF NOT a(char,1) THEN RETURN 
  402 IF battle THEN RETURN 
  405 GO SUB 20
  410 IF i$="0" THEN RETURN 
  420 IF i$="1" THEN GO SUB 50: GO SUB 20: GO SUB 45: GO TO 400
  430 IF i$<"5" OR i$>"8" THEN GO TO 400
  440 PRINT AT a(char,5)-1,a(char,4)-1; BRIGHT 0; OVER 1;" "
  450 LET nx=a(char,4)+(i$="8")-(i$="5"): LET ny=a(char,5)+(i$="6")-(i$="7")
  455 IF x$(ny,nx)=CHR$ 146 AND x$(a(char,5),a(char,4))<>CHR$ 152 THEN GO TO 480
  458 IF x$(ny,nx)=CHR$ 152 THEN LET full=0: FOR i=1 TO 11: LET full=full+(a(i,4)=nx AND a(i,5)=ny): NEXT i: IF full THEN GO TO 480
  460 IF x$(ny,nx)=CHR$ 144 OR FN n(char)=5 THEN GO TO 480
  465 IF x$(ny,nx)=CHR$ 146 THEN LET x$(ny,nx)=CHR$ 152: LET x$(a(char,5),a(char,4))=CHR$ 146: PRINT AT ny-1,nx-1; INK 0;CHR$ 152;AT a(char,5)-1,a(char,4)-1; INK 5;CHR$ 146
  468 LET a(char,2)=a(char,2)-5-(5 AND x$(a(char,5),a(char,4))=CHR$ 145)-(3 AND ((x$(a(char,5),a(char,4))=CHR$ 147) OR (x$(a(char,5),a(char,4)))=CHR$ 151)): IF a(char,2)<0 THEN LET a(char,2)=0
  470 LET a(char,4)=nx: LET a(char,5)=ny
  480 PRINT AT a(char,5)-1,a(char,4)-1; OVER 1;" ": GO TO 400
  499 REM  Character Descriptions         and options************ 
  500 LET x=a(char,4): LET y=a(char,5): LET battle=0: LET z$=FN f$(char): GO SUB 15
  501 IF NOT a(char,1) THEN LET z$=FN f$(char)+" was slain in the Battle of "+FN s$(FN c(y,x)): GO SUB 30: GO SUB 9: PAUSE 500: RETURN 
  502 LET z$=FN n$(char)+" stands "+FN d$(code-143)+" in the Shire of "+FN s$(FN c(y,x))
  505 IF a(char,1) THEN LET z$=z$+". "+("He" AND char<>8)+("She" AND char=8)+" commands "+STR$ a(char,1)+" men-at-arms who are "+FN q$(char)+". At present they are "+FN v$(char)
  510 GO SUB 30
  512 IF y=13 AND x=2 AND NOT t(y,x) THEN GO TO 6000
  515 IF t(y,x) THEN LET z$=FN n$(char)+" is confronted by "+STR$ t(y,x)+" warriors of Darkness, preparing to do battle": GO SUB 30
  520 PRINT ': LET z$="OPTIONS": GO SUB 40: PRINT : PRINT TAB 2;"1: Change character"'TAB 2;"2: View map or Move"'TAB 2;"3: Explore the "+FN b$(code-143)
  530 IF t(y,x) THEN PRINT TAB 2;"4: Attack!"
  540 IF code=149 THEN LET recr=FN c(y,x): IF NOT a(recr,6) AND recr<>12 THEN PRINT "  5: Greet "+FN f$(recr)
  545 IF m$(y,x)>CHR$ 100 AND a(char,1)<2500 THEN PRINT "  6: Recruit ";STR$ CODE m$(y,x);" men"
  546 IF a(char,9) THEN PRINT "  7: Distribute provisions"
  548 PRINT #1; PAPER 6;AT 1,0;"< Any other key for fresh news >"
  550 GO SUB 20
  560 IF i$="1" THEN RETURN 
  561 IF i$="2" THEN GO SUB 45: GO SUB 400: GO TO 500
  562 IF i$="3" THEN GO SUB 1000: GO TO 500
  563 IF i$="4" AND t(y,x) THEN LET ind=0: GO SUB 2000
  564 IF recr AND i$="5" THEN LET char=recr: LET a(recr,6)=1
  565 IF i$="6" AND a(char,1)<2500 AND m$(y,x)>CHR$ 100 THEN LET a(char,1)=a(char,1)+CODE m$(y,x): LET m$(y,x)=CHR$ 1
  570 IF i$="7" AND a(char,9) THEN LET a(char,2)=a(char,2)+50: LET a(char,9)=a(char,9)-1: IF a(char,2)>249 THEN LET a(char,2)=249
  599 GO TO 500
  999 REM   SEarch Location       
 1000 LET z$=FN f$(char): GO SUB 15
 1005 LET z$=FN n$(char)+" searches the "+FN b$(code-143): GO SUB 30
 1010 LET pres=0: DIM p(12): FOR i=1 TO 11: IF a(i,1) AND a(i,4)=x AND a(i,5)=y AND i<>char THEN LET pres=pres+1: LET p(pres)=i
 1015 NEXT i: IF NOT pres THEN GO TO 1100
 1016 LET end=(5 AND pres>5)+(pres AND pres<=5): LET start=1
 1020 LET z$=("He" AND char<>8)+("She" AND char=8)+(" also" AND start=6)+" finds ": FOR i=start TO end: LET z$=z$+FN f$(p(i))+" with "+STR$ a(p(i),1)+" men"+(", " AND i<>end)+("and " AND end>1 AND i=end-1): NEXT i: GO SUB 30
 1025 IF pres>5 AND start=1 THEN LET end=pres: LET start=6: GO TO 1020
 1030 GO SUB 9: PAUSE 500: GO SUB 10: LET z$=FN f$(char): GO SUB 15: LET z$=FN n$(char)+" continues to search the "+FN b$(code-143): GO SUB 30
 1100 IF x$(y,x)<>CHR$ 148 AND x$(y,x)<>CHR$ 149 THEN GO TO 1200
 1105 IF NOT a(FN c(y,x),1) THEN LET m$(y,x)=CHR$ 1
 1110 IF a(FN c(y,x),6) AND a(char,1)<2500 AND m$(y,x)<>CHR$ 1 AND m$(y,x)<CHR$ 100 THEN LET m$(y,x)=CHR$ (100+FN r(155)): LET z$="presently, "+STR$ CODE m$(y,x)+" freemen of "+FN s$(FN c(y,x))+" arrive bearing provisions for the army, and offer themselves for recruitment": GO SUB 30: LET a(char,9)=a(char,9)+1
 1200 IF NOT tu AND tot<15000 THEN LET z$="A mortally wounded warrior of Darkness staggers in and collapses. In his delirium, he speaks of the existence of a secret tunnel through the mountains to the keep of Darkness": GO SUB 30: LET tu=1: LET xtu=7: LET ytu=10+FN r(6): GO SUB 9: PAUSE 0: GO SUB 10: RETURN 
 1210 LET in=1 AND x<5 AND y>11 AND y<15
 1220 IF tu AND ((NOT in AND x=xtu AND y=ytu) OR (in AND x=4 AND y=13)) THEN LET a(char,4)=(4 AND NOT in)+(xtu AND in): LET a(char,5)=(13 AND NOT in)+(ytu AND in): LET z$=FN n$(char)+" discovers a secret tunnel. After passing through many dark passages, "+("he" AND char<>8)+("she" AND char=8)+" emerges into daylight": GO SUB 30: LET in=NOT in
 1250 LET z$=("He" AND char<>8)+("She" AND char=8)+" finds nothing else": GO SUB 30: GO TO 2090
 1999 REM   BATTLE                
 2000 CLS : LET armies=0: LET battle=1: LET fk=char: LET vx=a(fk,4): LET vy=a(fk,5): LET z$="The Battle of "+FN s$(FN c(vy,vx)): GO SUB 15: LET z$="The clash of steel upon steel rings through the Shire of "+FN s$(FN c(vy,vx)): GO SUB 30: PRINT : IF ind THEN LET ind=0: GO TO 2003
 2001 FOR i=1 TO 70: IF u(i,1) AND u(i,4)=vx AND u(i,5)=vy THEN LET m=i: GO TO 2003
 2002 NEXT i
 2003 LET z$="IN the Battle of "+FN s$(FN c(vy,vx))+", "+FN n$(fk)+" and "+("his " AND fk<>8)+("her " AND fk=8)+STR$ a(fk,1)+" men fought bravely against an army "+STR$ u(m,1)+" strong"
 2004 GO SUB 30: PRINT 
 2005 LET us=(INT (a(fk,2)*a(fk,2)*a(fk,3)/62500)): LET them=INT (u(m,1)*u(m,2)/300): LET us=us*(1+(x$(vy,vx)=CHR$ 149 AND vy<>13 AND vx<>2))
 2010 LET sup=us-them: LET theirloss=FN r(100)+(sup AND sup>0): IF theirloss>u(m,1) THEN LET theirloss=u(m,1)
 2015 LET t(vy,vx)=t(vy,vx)-theirloss: LET u(m,1)=u(m,1)-theirloss: LET tot=tot-theirloss
 2017 LET ourloss=FN r(100)-(sup AND sup<0): IF ourloss>a(fk,1) THEN LET ourloss=a(fk,1)
 2018 LET a(fk,1)=a(fk,1)-ourloss
 2020 IF NOT a(fk,1) THEN LET x$(a(fk,8),a(fk,7))=" "
 2025 LET a(fk,3)=a(fk,3)-(50 AND ourloss>100)+(50 AND ourloss<50): IF a(fk,3)<=0 THEN LET a(fk,3)=0
 2026 LET a(fk,2)=(a(fk,2)-50) AND a(fk,2)>=50
 2027 LET u(m,2)=(u(m,2)-50) AND u(m,2)>=50
 2030 IF a(fk,3)>248 THEN LET a(fk,3)=248
 2035 IF fk<>char THEN RETURN 
 2040 IF NOT a(fk,1) THEN LET z$=FN n$(fk)+" was slain": GO SUB 30: GO TO 2090
 2050 LET z$=FN n$(fk)+" slew "+STR$ theirloss+" of the enemy, and lost "+(STR$ ourloss AND ourloss)+("no" AND NOT ourloss)+(" men" AND ourloss>1)+(" man" AND ourloss=1): GO SUB 30
 2090 GO SUB 9: PAUSE 500: CLS : GO SUB 10
 2999 RETURN 
 4999 REM   SELECT CHAR. MENU     
 5000 CLS : LET lives=NOT PI: LET char=NOT PI: LET z$="SELECT CHARACTER": LET code=154: GO SUB 16: PRINT '': FOR i=1 TO 11
 5010 IF a(i,6) THEN LET lives=lives+(1 AND a(i,1)): PRINT TAB 4; INK (2 AND NOT a(i,1));CHR$ (64+i);":";TAB 7;FN f$(i)
 5015 NEXT i
 5016 IF NOT lives THEN GO TO 6500
 5017 PRINT '"    L: Key to map symbols"'"    M: Suspend play"
 5020 GO SUB 20: IF i$<"a" OR i$>"m" THEN GO TO 5020
 5025 IF i$="l" THEN GO SUB 7500: GO TO 5000
 5026 IF i$="m" THEN PRINT #1;"        PLAY SUSPENDED": PAUSE NOT PI: GO SUB 10: GO TO 5000
 5030 IF a(CODE i$-96,6) THEN LET char=CODE i$-96: GO SUB 500
 5050 GO TO 5000
 5999 REM     VICTORY             
 6000 LET z$="The Keep of Darkness is captured, and the foe defeated, Let all freemen of the Shires rejoice!": PRINT : GO SUB 30
 6010 GO TO 6010
 6499 REM     DEFEAT              
 6500 LET z$="The Shires are deafeatd by the forces of Darkness. All is lost": PRINT : GO SUB 30
 6510 GO TO 6510
 7499 REM   DISPLAY MAP SYMBOLS   
 7500 LET code=149: LET z$="KEY TO MAP SYMBOLS": GO SUB 16
 7505 FOR i=144 TO 153: PRINT TAB 7; INK FN i(i);CHR$ i;TAB 10; INK 0;FN b$(i-143): NEXT i
 7510 PRINT TAB 7;CHR$ 154;TAB 10;"enemy army"'TAB 7;"";CHR$ 154;"";TAB 10;"Shire army"
 7515 GO SUB 9: PAUSE 500: GO SUB 10: RETURN 
 7999 REM LOAD MAP ARRAY & CODE AND INITIALISE                  
 8000 BORDER 7: PAPER 7: INK 0: CLEAR 59999: LOAD "SHIRES map" DATA x$(): LOAD "SHIRES prt"CODE : REM LOAD "SHIRES udg"CODE 
 8900 RESTORE : RANDOMIZE : DIM m$(22,32): DIM f$(12,20): DIM p$(10,20): DIM v$(10,21): DIM a(12,9): DIM u(70,5): DIM t(22,32)
 8905 RANDOMIZE USR 60474
 8910 FOR i=1 TO 12: READ x,y,f$(i,PI TO ): LET f$(i,1)=CHR$ x: LET f$(i,2)=CHR$ y: NEXT i
 8920 LET z$="THE WAR OF THE SHIRES": LET code=149: GO SUB 16: LET z$="Thunder rumbles in the West": PRINT AT 7,0;: GO SUB 40: LET z$=FN f$(1): PRINT AT 10,0;: GO SUB 40: LET z$="prepares for battle": PRINT AT 11,0;: GO SUB 40
 8930 FOR i=1 TO 10: READ x,y,p$(i,PI TO ): LET p$(i,1)=CHR$ x: LET p$(i,2)=CHR$ y: NEXT i
 8940 LET tu=0: LET ind=tu: LET xtu=tu: LET ytu=tu: LET in=tu: LET armies=tu: LET n=1: LET a(n,6)=n: LET battle=tu: LET char=n
 8950 FOR i=1 TO 12: READ a(i,4),a(i,5): LET a(i,7)=a(i,4): LET a(i,8)=a(i,5): LET a(i,1)=1000+FN r(1000): LET a(i,2)=249: LET a(i,3)=249: NEXT i
 8960 FOR i=1 TO 10: READ x,v$(i,2 TO ): LET v$(i,1)=CHR$ x: NEXT i
 8970 FOR i=1 TO 70: LET u(i,1)=1000+FN r(1000): LET t(13,2)=t(13,2)+u(i,1): LET u(i,2)=200: LET u(i,PI)=FN r(11): LET u(i,4)=2: LET u(i,5)=13: NEXT i: LET tot=t(13,2)
 8980 GO SUB 9: PAUSE 0
 8999 GO TO 5000
 9000 DATA 8,17,"RolandGreenways"
 9001 DATA 8,17,"RanolfDeepmeads"
 9002 DATA 8,18,"MorganClearwater"
 9003 DATA 8,17,"AylwinEastlands"
 9004 DATA 8,19,"AldredLittlemeads"
 9005 DATA 8,18,"AlaricHighcliffe"
 9006 DATA 8,17,"EgbertNortkwood"
 9007 DATA 10,18,"MarianneDeepwood"
 9008 DATA 7,16,"EdgarBleakways"
 9009 DATA 8,17,"HubertWorthings"
 9010 DATA 9,16,"WilliamMarland"
 9011 DATA 7,15,"UrlicDarkness"
 9060 DATA 3,10,"mountain"
 9061 DATA 8,20,"upon rolling downs"
 9062 DATA 3,7,"water"
 9063 DATA 6,13,"in woodland"
 9064 DATA 8,14,"in a village"
 9065 DATA 10,13,"at the keep"
 9066 DATA 6,18,"in green meadows"
 9067 DATA 8,18,"in a pine forest"
 9068 DATA 12,15,"on board ship"
 9069 DATA 8,12,"on a plain"
 9070 DATA 14,20,4,20,23,21,30,21,25,14,31,11,10,9,17,5,28,3,15,2,2,2,2,13
 9071 DATA 15,"full of vigor"
 9072 DATA 15,"in good fettle"
 9073 DATA 15,"a little weary"
 9074 DATA 6,"weary"
 9075 DATA 21,"in sore need of rest"
 9076 DATA 21,"in excellent spirits"
 9077 DATA 16,"in good sprits"
 9078 DATA 20,"slightly dispirited"
 9079 DATA 16,"very dispirated"
 9080 DATA 13,"without hope"
 9100 DATA 14,20,4,20,23,21,30,21,25,14,31,11,10,9,17,5,28,3,15,2,2,2,2,13
 9997 STOP 
 9998 SAVE "SHIRES" LINE 8000: SAVE "SHIRES map" DATA x$(): SAVE "SHIRES prt"CODE 60000,482: REM SAVE "SHIRES udg"CODE USR "\a",88

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top