ZXTape!Doune # #% 1000  ( 1500 2 9200# < day=1 F 2000 P 2500 Z 3000 d 3500 n 4000 x 44000 4500 4700\ 5000 <.35200P 5300 9200# 5500| 9200# day=day+1 8300l 70F ,a(8):p(6,6):n(6) ,e(3):d(6,4):t(6)  c(6)  l(6)  9900& x=18 $i .a(x)=i 8x>2a(x)=(*i) Bx LMe(1)=300,:e(2)=502:e(3)=(*10 +1) Vx=16 `c(x)=1:t(x)=1 jx t "THE SIEGE OF DOUNE CASTLE" q'"It is the 14th century. You"'"command an army of 300"'"infantrymen laying siege to"'"Doune Castle, Scotland." "In your role of general, you"'"request the quantities of"'"supplies and equipment required from your supporting tradesmen who will deliver all they can." @'"In calculating the food you willuse, remember that each man and archer in the army eats a tenth of a sack of food in a day." h "DAY ";day;" OF THE SIEGE"   9600% x=18 i$ i$;":";15;a(x)  x  9700%  x=16 *i$ 4i$;":";15; >z=c(x) H 6000p Rx \ :17,0;"Do you wish to issue full"'"rations?" a$ a$=""2510 ,a$(1)="y"a$(1)="Y"r=1 -a$(1)"y"a$(1)"Y"62008 =a(8)=(a(8)-(a(1)+a(2))*r/10 )  9610% x=16 9500% i$ ""How many ";i$;" do you"'"need?" a a=a n(x)=a x  tl=1  9800H& &x=16 0i :tl=tl+n(x)*i Dx Nx=16 Xn(x)=(500*n(x)/tl) bx l 9700% x=16 l(x)=0 9500% i$ $"Do you wish to attack the"'i$;"?" a$ 6a$""a$(1)="y"a$(1)="Y"l(x)=1 x x=16 l(x)=03800 $ 9700% . z=1x 8i$ Bz L 9600% Vy=16 `j$ jLx<6y=6x=6y>2y<6a(y)=03780 t 9500% ~i$;" attack:" "How many ";j$;"?" a a=a a(y)-a<06400  a(y)=a(y)-a  p(x,y)=a y :p(x,1)=0p(x,2)=0l(x)=-1 x  )"You left ";a(1);" men on guard."  c=0:t=0 x=16  t=t+t(x) c=c+2-c(x) x x=16 y=13 d(x,y)=(e(y)*t(x)/t) e(y)=e(y)-d(x,y) y +d(x,4)=(502*(2-c(x))/c) x  0 9700% :x=15 Di$ N,p(x,3)>0x<67000X Xx b 9200# l  9700% x=16 i$ l(x)0i$;" attack:" 2l(x)<0"You can't attack without people!" l(x)>07500L x  9200#  \ fdis=(*a(1)/2) pa(1)=a(1)-dis z4dis>0"Today, ";dis;" men died of disease."  des=0  r<1des=(*a(1)) =des>0"Because of low rations, ";des'"men deserted." a(1)=a(1)-des e(1)=e(1)+des  x=16 y=12 a(y)=a(y)+p(x,y) e(y)=e(y)+d(x,y) y $e(3)=e(3)+d(x,3) x #a(1)<20*8000@  a(8)<08100 Je(1)<0e(1)<502e(1)1c(x)=1 x  |)"The labourers have supplies you with:"  9610% x=16 i$ i$;":";15;n(x)  a(x+2)=a(x+2)+n(x) x x=16 !l(x)=1t(x)=t(x)+1 y=36 a(y)=a(y)+p(x,y) y x  pz=1"un"; z"z<1z.9ffff"hardly "; %z<.9ffffz.73333"slightly "; "z<.5z.3"badly "; z<.3"seriously ";  "damaged."  8A"What decimal fraction of normal rations do you wish to issue?" La Vr=a ` !"You do not have enough"'j$;"!"  150  9500%  3700t Xh=0:th=0 by=1p(x,3) l(a(7)-1<07070 va(7)=a(7)-1 h=(30*) c(x)=c(x)-h/100d  th=th+h y 5'"The bombardment on the"'i$;" scored ";th;" hits."  Lzbf=(15*p(x,4)+p(x,5)+3*p(x,6)+2*p(x,2)/(1+d(x,2)))/(c(x)+.1}L) Vm=p(x,1) `n=d(x,1) j 9000(# tp(x,1)=m ~d(x,1)=n >p(x,2)=(p(x,2)*(1-d(x,2)/502)) >d(x,2)=(d(x,2)*(1-p(x,2)/502)) dc=(*10 *d(x,3)) dc>p(x,1)dc=0 =dc>0"The cauldrons of boiling oil"'"killed ";dc;"." p(x,1)=p(x,1)-dc >x=6c(6)=c(6)-p(6,6)/20 w=46 p(x,w)=(*p(x,w)/2) w  ;p(x,1)>(4+*3)*d(x,1)8200  @L'"Your few remaining men have"'"mutinied."'"You have lost on day ";day;"." ^ 85004! F'"You have run out of food. You have to surrender on day ";day;"."  85004! ,'"The castle has surrendered -"'"victory!" "You won in ";day;" days." & 85004! lx=16 vn(x)=0 y=14 d(x,y)=0 y>48360 p(x,y)=0 y x  !4'"Do you want another game?" !Ha$ !R*a$""a$(1)="y"a$(1)="Y" !\ 10000' #(%ad=(*m/(2*(bf+10 ))) #2ad>mad=(*m) #< ed=(*n) #F1"You lost ";ad;" men. The enemy"'"lost ";ed;"." #Pm=m-ad #Zn=n-ed #d #'"Press a key to continue." $=""9220$ $ $ %17,0; %&q=15 %0,, %:q %D17,0; %N %"Men","Archers" %W"Catapults","Siege Towers","Ladders","Battering-Rams","Sacks of Rock","Sacks of Food" %B"North Wall","South Wall","East Wall","West Wall","Keep","Gates" &H6502,100d,10 ,30,2,1 &H300,,502,5,4,10 ,6,10 ,200 !