ZXTape! 0Created with Ramsoft MakeTZXSTAR TREK }}l the computer program AUTHOR - Jonathan Nixon. X0:7:0:0:0:0:7:::23658j\,0 tg(8,8):s(8,8):b(8,8):s$(357e):b$(6):e$(64@):f$(64@) 0e(5):x(5):y(5):p(5) Id(5):d$(5,16):40(:n=15:d$(n):n (G"Photon torpedoes","Scanners","Ion drive","Warp drive","Phaser banks" 23a="a":60<:n=071G:r:a+n,r:n <0,63?,0,0,0,3,1,0,0,240,128,143,156,254,252,0,0,0,224,252,0,0,0,0 F0,28,31,15,31,62>,62>,0,0,0,128,255,0,0,0,0,0,0,568,252,0,0,0,0 P0,0,0,15,15,0,0,0,0,60<,195,255,255,195,60<,0,0,0,0,240,240,0,0,0 dUg$=22+0+0+23+10 +0+"GALACTIC MAP"+6 ny=81-1 xRg$=g$+20+1+y+20+0+"---:---:---:---:---:---:---:---" y Pg$=g$+20+1+" 1 2 3 4 5 6 7 8 "+20+0 9000(# t2=(*1001)+1000 k1=(*513)+502 b1=(*6)+5 _2000:6,0;" One moment please captain, I'm just creating the universe..." Yx=18:y=18:g(x,y)=(*4)+1:b(x,y)=0:y:x b1=0330J n=1b1 Lx=(*8)+1:y=(*8)+1:g(x,y)10 240 +g(x,y)=g(x,y)+10 :b(x,y)=4000 n n=14 Mx=(*8)+1:y=(*8)+1:g(x,y)400280 "g(x,y)=g(x,y)+400 ,n Jn=17k1 TMx=(*8)+1:y=(*8)+1:g(x,y)300,340T ^g(x,y)=g(x,y)+100d hn  2010 110 ,0;"Acceptable scenario (Y/N)?"; ""410 (i$=:i$=""(i$"y"i$"n")420 i$:i$="y"520 '"Create your own (Y/N)?"; ""450 (i$=:i$=""(i$"y"i$"n")460 i$:i$="n"150 ba$="Target date (100-200)":9600%:t2=(10 *i):t2<1000t2>2000480 Ua$="Klingon force (50-100)":9600%:k1=i:k1<502k1>100d490 Ia$="Bases (0-20)":9600%:b1=i:b1<0b1>20500  190 "Self-destruct code?";e$  2110> &Jw=0:u=0:bax=0:bay=0:t1=0:k2=k1:b2=b1 0Hen=2000:sh=1000:pt=10 :comp=0:bomb=1: :dgx=(*8)+1:gy=(*8)+1:sx=(*8)+1:sy=(*8)+1 N:2210:2470 S tempt=t1 Xdock=0:coms=3 Y2x=sx-1sx+1:y=sy-1sy+1 ZD(sx-x)=(sy-y)x<1x>8y<1y>8609a [s(x,y)3609a \ib(gx,gy)0opop=0:21,0;"Starbase no longer operational",:1:502 ]b(gx,gy)0609a _dock=1:pt=10 :b(gx,gy)=b(gx,gy)+en+sh:en=2000:sh=1000:b(gx,gy)=b(gx,gy)-3000 :n=15:d(n)=0:n `mb(gx,gy)<0b(gx,gy)=b(gx,gy)+en+sh:en=(2*b(gx,gy)/3):sh=b(gx,gy)-en:b(gx,gy)=0 ay:x b 2470 Tt2-t1<2021,0;"Target date approaching...",:1:502 %en0end=1:8300l  t1t2end=2:85004! %k1=0end=3:85004! 821,0,,21,0;"Command (1-8)?"; n=502:key=1 keyƦ""725 -key=0:i$=:i$"1"i$"8"730 #n=n-1:n>0710 key720 5tempt=tempt+2:21,0,,:743 X21,0,,;0,0:g=4800+200*i$:compg=g+1600@ Z0:g:coms=coms-1:2470 :21,0,,:tempt=t1coms700 ogx=baxgy=baybax=0:bay=0:21,0;"Attack on starbase postponed",:1:502 %n=15:d(n)746 d(n)=d(n)-(tempt-t1) Ud(n)0d(n)=0:21,0;d$(n);" REPAIRED",:.2~L,40( n Qkse(5)>0760:katt=katt+1:katt>5katt=1  1280 -n=katt:e(n)>01160:775 /katt=katt+1:katt>5katt=1  760  0n=5osxp(n)ú(*4)1050  s(x(n),y(n))=5  Ix1=x(n):y1=y(n):tx=x1:ty=y1:x2=osx:y2=osy:x1=x2y1=y21050 5(x2-x1)>(y2-y1)ix=(x2-x1):iy=(y2-y1)/(x2-x1)  5(y2-y1)>(x2-x1)iy=(y2-y1):ix=(x2-x1)/(y2-y1) *-(x2-x1)=(y2-y1)ix=(x2-x1):iy=(y2-y1) 4:tx=tx+ix:ty=ty+iy:x1=(tx+.5):y1=(ty+.5) >}x1<1x1>8y1<1y1>8tx=tx-ix:ty=ty-iy:x1=(tx+.5):y1=(ty+.5):c=0:860\ H:s(x1,y1)0s(x1,y1)5c=s(x1,y1):860\ R 8204 \s(x(n),y(n))=2 ^Jc3((x1-x(n))<(osx-x(n)))((y1-y(n))<(osy-y(n)))1050 _kc1c4s(x1,y1)=0:z=41)+x1*3+(8-y1)*36$:s$(zz+2)=" " `c2870f aPk=14:x(k)=x1y(k)=y1e(k)=0:k1=k1-1:ks=ks-1 bk fp(n)=p(n)-1 phedx=20+24*x1:edy=171-8*(9 -y1):epx=1+3*x1:epy=(9 -y1) zBkdx=20+24*x(n):kdy=171-8*(9 -y(n)) ?(edx-kdx)>(edy-kdy)ix=(edx-kdx):iy=(edy-kdy)/(edx-kdx) ?(edy-kdy)>(edx-kdx)iy=(edy-kdy):ix=(edx-kdx)/(edy-kdy) 5(edx-kdx)=(edy-kdy)ix=(edx-kdx):iy=(edy-kdy) B21,0;"Klingon at ";x(n);",";y(n);" firing torpedo", k=08:.01z# =,k*k:k:1:x=kdx:y=kdy:x2=x:y2=y:x,y:0,2:2,0:0,-2:-1,0 Pix=1x=kdxedx4*ix:5785:y=kdy+(x-kdx)*iy:x:960 8y=kdyedy4*iy:5785:x=kdx+(y-kdy)*ix:y zx2,y2:0,2:2,0:0,-2:1;0;0;0;-1,0:0 ʗc>1s$;:epy,epx;1;" ";6;0;1;1;" ";:1;" ":k=110 :.02{# =,(*502)-25:k c=1s$;:epy,epx+1;6;2;1;1;1;" ";:k=110 :.02{# =,(*502)-25:k:21,0;"200 unit hit on shields",:1:502:sh=sh-200:2470 :2590 Ԗc=221,0;"Klingon gunner court-marshalled",:g(gx,gy)=g(gx,gy)-100d:z=21+gx*4+(8-gy)*36$:g$(z)=ks ޽c=321,0;"Starbase destroyed",:b1=b1-1:b(gx,gy)=0:bs=0:g(gx,gy)=g(gx,gy)-10 :z=21+gx*4+(8-gy)*36$:g$(z+1)="0" >c=621,0;"Romulan destroyed",:r=0 9c=421,0;"Torpedo energy absorbed", c11:502  770 e(n)<2770 .pe=(e(n)/2) 3Khe=(3*pe/((sx-x(n))*(sx-x(n))+(sy-y(n))*(sy-y(n)))):he>pehe=pe 4he<1770 5 e(n)=pe 6_n<521,0;"Klingon at ";x(n);",";y(n);" using phasers",:1:502 7Jn=521,0;"Romulan using phasers",:1:502 8hedx=20+24*sx:edy=171-8*(9 -sy):epx=1+3*sx:epy=(9 -sy) Bpkdx=20+24*x(n):kdy=171-8*(9 -y(n)):kpx=1+3*x(n):kpy=(9 -y(n)) LPn<5kdx,kdy:1;6;edx-kdx,edy-kdy:kpy,kpx;1;"" Q4epy,epx;6;2;1;1;"" V%m=17:.01z# =,m*m:m jA21,0;he;" unit hit on shields",:1:502 t"sh=sh-he:2470 :2590 ~2470 :770 e(n)<61210 :x=(*3)-1+x(n):y=(*3)-1+y(n) 5x<1x>8y<1y>81160 s(x,y)1160 s(x(n),y(n))=0:z=41)+x(n)*3+(8-y(n))*36$:s$(zz+2)=" ":x(n)=x:y(n)=y:s(x,y)=2*(n<5)+6*(n=5):e(n)=e(n)-5:n<5z=41)+x*3+(8-y)*36$:s$(zz+2)="":s$:1:502 8n=5e(n)>100dp(n)ź(*3)1270 !x(n)<5x=gx-(*2) !x(n)>4x=gx+(*2) !y(n)<5y=gy-(*2) !y(n)>4y=gy+(*2) x=gxy=gy1210 x<1x=8 x>8x=1 y<1y=8 y>8y=1 g(x,y)4001210 K21,0;"Klingon moving to sector ";x;",";y,:1:502 s(x(n),y(n))=0:z=41)+x(n)*3+(8-y(n))*36$:s$(zz+2)=" ":s$:g(gx,gy)=g(gx,gy)-100d:ks=ks-1:e(n)=0:z=21+gx*4+(8-gy)*36$:g$(z)=((g$(z))-1):g(x,y)=g(x,y)+100d s$  bax1310  bx=(*8)+1:y=(*8)+1:g(x,y)<100db(x,y)(x=gxy=gy)1320( {bax=x:bay=y:21,0;2;7;1;" Starbase ";bax;",";bay;" under attack",:1:75K Qb(bax,bay)=b(bax,bay)-(*1500):b(bax,bay)0b(bax,bay)=0:21,0;2;7;1;" Starbase ";bax;",";bay;" destroyed",:1:502:b1=b1-1:g(bax,bay)=g(bax,bay)-10 :z=21+bax*4+(8-bay)*36$+1:bax=0:bay=0:g$(z)"-"g$(z)="0" "sh<0en=en+sh:sh=0  t1=tempt osx=sx:osy=sy  600X print title Ы:2;" the computer program": print scenario @6,0;"You have until stardate ";:t=t2:2060  1,"To destroy ";k1;" klingon";:k11"s"; 1b11,"There are ";b1;" bases available" ,b1=1,"There is one base available"  print reformatted time  t<10000; t<100d0; *.t/10 ;:t/10 =(t/10 )".0"; 4 9print command options >310 ,0;" CONTROL ROOM COMPUTER",,, H!"1: Manoeuvre Hyper-drive", R"2: Shields Status", \ "3: Phasers Navigation", f "4: Photon Torps Lock torps", p"5: Scan Probe", z "6: Instructions Smart-bomb", #"7: Galactic map Self-destruct", ""8: Computer Control room", H21,0;"Press any key to continue...":1:0:: -21,0;"Entering new sector...", katt=1 initialise sector map Ys$=22+0+0+20+1+" 1 2 3 4 5 6 7 8 " y=81-1 ts$(41)+(8-y)*36$)=y+20+1+" "+20+1+y+" " y 0s$(329I)=" 1 2 3 4 5 6 7 8 " rdock=0:bx=0:by=0:osx=0:osy=0:lock=0:n=14:e(n)=0:n  ss=g(gx,gy) (ks=(ss/100d):ss=ss-100d*ks &bs=(ss/10 ):ss=ss-10 *bs Jz=21+gx*4+(8-gy)*36$:g$(zz+2)=ks+bs+ss <x=18:y=18:s(x,y)=0:y:x $n=15:e(n)=0:n place enterprise Vs(sx,sy)=1:z=41)+sx*3+(8-sy)*36$:s$(zz+2)="" ks=02380L $n=1ks .Lx=(*8)+1:y=(*8)+1:s(x,y)02350. 3place klingon 8s(x,y)=2:z=41)+x*3+(8-y)*36$:s$(zz+2)="":e(n)=400:x(n)=x:y(n)=y:p(n)=3 Bn Lbs=02410j VLx=(*8)+1:y=(*8)+1:s(x,y)02390V [place starbase `js(x,y)=3:bx=x:op=1:by=y:z=41)+x*3+(8-y)*36$:s$(zz+2)="" jss=02460 tn=1ss ~Lx=(*8)+1:y=(*8)+1:s(x,y)02430~ place star Rs(x,y)=4:z=41)+x*3+(8-y)*36$:s$(zz+2)=" * " n (*10 )2460 Lx=(*8)+1:y=(*8)+1:s(x,y)02452 place Romulan Bs(x,y)=6:e(5)=500:x(5)=x:y(5)=y  A2:11 ,0;"SECTOR ";gx;",";gy,"CONDITION "; &dock0;"DOCKED";:2510 5kse(5)2;7;1;"RED";:, 0kse(5)4;0;"GREEN";:, dam=0 /sh<0en=en+sh:sh=0:dam=1 1"ENERGY ";en,"STARDATE ";:t=t1:2060  #,"SHIELDS ";sh,"KLINGONS ";k1, "TORPEDOES ";pt,"COMPUTER "; 1 comp6;0;"ON";:,,,"1: Hyper-drive","5: Probe","2: Status","6: Smart-bomb","3: Navigation","7: Self-destruct4: Lock torps","8: Control room", comp0;"OFF";:,,,"1: Manoeuvre","5: Scan","2: Shields","6: Instructions","3: Phasers","7: Galactic map","4: Photon torps","8: Computer", 0:s$  Damage routine dam (<d1=(*5)+1:d1<1d1>52600( <$d(d1)=d(d1)+(*10 )+10 F;21,0;"Damage to ";d$(d1),:1:502 PT21,0;:t=d(d1):2060 :" stardays to repair",:1:502 d ny1=y2x1=x2b$=" 0.00": xy1=y2x1x2b$="270.00": 1b=(18000PF*((x2-x1)/(y2-y1))/)/100d y2y1x284800 w=i:w<1 Ven20*w21,0;"Not enough energy",:1:502:4800 Fa$="Bearing (0-360)?":9600%:i<0i>360h4820 @b=i*/180:en=(en-20*w):tempt=(tempt+w*8) ox=gx:oy=gy:osx=sx:osy=sy 'c=0:u=8:5060:c &x1=gx*8+osx:y1=gy*8+osy @x2=(.5+x1+8*w*b):y2=(.5+y1+8*w*b) ;x29 x272Hy29 y272H4930B x2<9 x2=64@+x2 $x2>72Hx2=x2-64@ .y2<9 y2=64@+y2 8y2>72Hy2=y2-64@ = 4880 L0gx=(x2/8):gx=x2/8gx=gx-1 V0gy=(y2/8):gy=y2/8gy=gy-1 `sx=x2-8*gx jsy=y2-8*gy ls(osx,osy)=0:z=41)+osx*3+(8-osy)*36$:s$(zz+2)=" ":s(sx,sy)=1:z=41)+sx*3+(8-sy)*36$:s$(zz+2)="" tgxoxgyoy2210 ~ /21,0;"Warp or Ion drive (W/I)?"; ""5010 )i$=:i$=""(i$"w"i$"i")5020 i$="w"4800 $d(3)d1=3:2630F !21,0;"ION DRIVE",,  w=0 @a$="Units (0-8)?":9600%:i<0i>85030 u=i:u<1 Uen5*u21,0;"Not enough energy",:1:502:5028 g21,0;"ION DRIVE",,:a$="Bearing (0-360)?":9600%:i<0i>360h5040 &en=en-(5*u):tempt=(tempt+u) b=i*/180:c=0 Lx1=sx:y1=sy:tx=x1:ty=y1:x2=(.5+x1+u*b):y2=(.5+y1+u*b) B(x2-x1)>(y2-y1)ix=(x2-x1):iy=(y2-y1)/(x2-x1):ct=(x2-x1) B(y2-y1)>(x2-x1)iy=(y2-y1):ix=(x2-x1)/(y2-y1):ct=(y2-y1) :(x2-x1)=(y2-y1)ix=(x2-x1):iy=(y2-y1):ct=(x2-x1) Itx=tx+ix:ty=ty+iy:x1=(tx+.5):y1=(ty+.5):ct=ct-1 9x11x18y11y1851702 w &x1<1gx+ix<1gx=9 &x1>8gx+ix>8gx=0 &y1<1gy+iy<1gy=9 &y1>8gy+iy>8gy=0 =x1<1gx=gx-1:tx=8:x1=tx:x2=x2+8  =x1>8gx=gx+1:tx=1:x1=tx:x2=x2-8 =y1<1gy=gy-1:ty=8:y1=ty:y2=y2+8 =y1>8gy=gy+1:ty=1:y1=ty:y2=y2-8 #sx=x1:sy=y1 (2210:2470 2Ds(x1,y1)>1c=s(x1,y1):he=(u*(i$="i")+10 *w*(i$="w")) <cct>05090 ==ctx=tx-ix:ty=ty-iy:x2=(.5+tx):y2=(.5+ty) >s(sx,sy)=0:z=41)+sx*3+(8-sy)*36$:s$(zz+2)=" ":sx=x2:sy=y2:s(sx,sy)=1:z=41)+sx*3+(8-sy)*36$:s$(zz+2)="":s$ Ac=221,0;"Collision with klingon at ";x1;",";y1,:1:502:n=0:k=14:n=n+k*(x(k)=x1)*(y(k)=y1):k:e(n)=e(n)-he:e(n)0e(n)=0:21,0;"Klingon destroyed",:1:502:k1=k1-1:s(x(n),y(n))=0:z=41)+x(n)*3+(8-y(n))*36$:s$(zz+2)=" ":g(gx,gy)=g(gx,gy)-100d:z=21+gx*4+(8-gy)*36$:ks=ks-1:g$(z)=ks Bc=321,0;"Collision with base at ";x1;",";y1,:1:502:b(gx,gy)=b(gx,gy)-he:b(gx,gy)0b(gx,gy)=0:21,0;"Starbase no longer operational",:1:502:b(gx,gy)=0 Cac=421,0;"Stopped by star at ";x1;",";y1,:1:502:he=he*2 Dc=621,0;"Collision with Romulan at ";x1;",";y1,:1:502:e(5)=e(5)-he:e(5)0e(5)=0:21,0;"Romaulan destroyed",:1:502:s(x(5),y(5))=0 Efcs$;:21,0;he;" units drained from shields",:1:502:sh=sh-he:2590 F P+en=en+sh:sh=0:tempt=tempt+1 Z>a$="Shield energy (0-"+(en-1)+")?":9600%:sh=i d&sh<0sh>en-15210Z n en=en-sh x $d(5)d1=5:2630F Tkse(5)21,0;"No klingons to shoot at",:1:502: Qdock21,0;"You may not attack while docked",:1:502: >a$="Phaser energy (0-"+(en-1)+")?":9600%:pe=i "&pe<0pe>en-15400 'pe=0 (5tempt=tempt+2*ks+2*(e(5)>0) ,Ren=en-pe:pe=(pe/(ks+(e(5)>0))):en=en+pe*(ks+(e(5)>0)) 1hedx=20+24*sx:edy=171-8*(9 -sy):epx=1+3*sx:epy=(9 -sy) 6n=15 @e(n)5520 E en=en-pe Jpkdx=20+24*x(n):kdy=171-8*(9 -y(n)):kpx=1+3*x(n):kpy=(9 -y(n)) NKhe=(3*pe/((sx-x(n))*(sx-x(n))+(sy-y(n))*(sy-y(n)))):he>pehe=pe PZhe=021,0;"Phaser energy too low...",:1:502:5520 T7n<5edx,edy:1;6;kdx-edx,kdy-edy YXepy,epx;1;"":n<5kpy,kpx;6;2;1;1;"" ^%m=17:.01z# =,m*m:m r^n<521,0;he;" unit hit on klingon at ";x(n);",";y(n),:1:502 wLn=521,0;he;" unit hit on Romulan",:1:502 |e(n)=e(n)-he 3n<5e(n)0e(n)=0:21,0;"Klingon destroyed",:1:502:k1=k1-1:s(x(n),y(n))=0:z=41)+x(n)*3+(8-y(n))*36$:s$(zz+2)=" ":g(gx,gy)=g(gx,gy)-100d:z=21+gx*4+(8-gy)*36$:ks=ks-1:g$(z)=ks xn=5e(n)0e(n)=0:21,0;"Romulan destroyed",:1:502:s(x(n),y(n))=0 2470 :n  $d(1)d1=1:2630F Qdock21,0;"You may not attack while docked",:1:502: Gpt21,0;"No torpedoes aboard...",:1:502: lockks5610 *21,0;"Torpedoes locked...", 6f=0:k=14:e(k)ptf5607 k: Ef=1:x1=sx:y1=sy:tx=x1:ty=y1:x2=x(k):y2=y(k):5640  5606 Fa$="Bearing (0-360)?":9600%:i<0i>360h5610 b=i*/180:c=0 Zx1=sx:y1=sy:tx=x1:ty=y1:x2=(.5+x1+15*b):y2=(.5+y1+15*b) $pt=pt-1:tempt=tempt+3  5(x2-x1)>(y2-y1)ix=(x2-x1):iy=(y2-y1)/(x2-x1) 5(y2-y1)>(x2-x1)iy=(y2-y1):ix=(x2-x1)/(y2-y1) -(x2-x1)=(y2-y1)ix=(x2-x1):iy=(y2-y1) &:tx=tx+ix:ty=ty+iy:x1=(tx+.5):y1=(ty+.5) 0c=0:x1<1x1>8y1<1y1>8tx=tx-ix:ty=ty-iy:x1=(tx+.5):y1=(ty+.5):c=1:sx=x1sy=y1c=5 2c5710N :s(x1,y1)>1c=s(x1,y1):c4s(x1,y1)=0:z=41)+x1*3+(8-y1)*36$:s$(zz+2)=" " ?c>15705I D 5670& Ic25710N J]n=14:x(n)=x1y(n)=y1e(n)>0e(n)=0:k1=k1-1:ks=ks-1 Kn N>edx=20+24*sx:edy=171-8*(9 -sy) Xhkdx=20+24*x1:kdy=171-8*(9 -y1):kpx=1+3*x1:kpy=(9 -y1) ]?(kdx-edx)>(kdy-edy)ix=(kdx-edx):iy=(kdy-edy)/(kdx-edx) b?(kdy-edy)>(kdx-edx)iy=(kdy-edy):ix=(kdx-edx)/(kdy-edy) g5(kdx-edx)=(kdy-edy)ix=(kdx-edx):iy=(kdy-edy) ln=08:.01z# =,n*n:n:1:x=edx:y=edy:x2=x:y2=y:x,y:0,2:2,0:0,-2:-1,0 n+c=50:c=1:5760 qQix=1x=edxkdx4*ix:5785:y=edy+(x-edx)*iy:x:5755{ v8y=edykdy4*iy:5785:x=edx+(y-edy)*ix:y {Vx2,y2:0,2:2,0:0,-2:-1,0:0 1c=1s$;:21,0;"Missed...",, c>1s$;:kpy,kpx;1;" ";6;2;1;1;" ";:1;" ":n=110 :.02{# =,(*502)-25:n c=221,0;"Nice shooting, Klingon destroyed":g(gx,gy)=g(gx,gy)-100d:z=21+gx*4+(8-gy)*36$:g$(z)=ks c=321,0;"That wasn't very clever, was it!":b1=b1-1:b(gx,gy)=0:bs=0:g(gx,gy)=g(gx,gy)-10 :z=21+gx*4+(8-gy)*36$:g$(z+1)="0" :c=421,0;"Torpedoe energy absorbed", Rc=621,0;"Well done, Romulan destroyed",:e(5)=0 1:502: qx2,y2:0,2:2,0:0,-2:7;0;0;0;-1,0 ox,y:0,2:2,0:0,-2:6;2;1;1;-1,0 .01z# =,30 x2=x:y2=y: $d(2)d1=2:2630F y0,0,,1,,,,,,,,,,,,,,,,,,:tempt=tempt+2:0,0;8;0;" KBS KBS KBS", Q1:y=gy+1gy-1-1:8;"",8; x=gx-1gx+1 cx1=x+8*(x<1)-8*(x>8):y1=y+8*(y<1)-8*(y>8):a$="" s=g(x1,y1):a$="" s<100da$=a$+"0" s<10 a$=a$+"0"  a$=a$+s Az=21+x1*4+(8-y1)*36$:g$(zz+2)=a$  "";a$;"";  $x:,8;"",:y N0:21,0;"Press any key to continue...",:1:0   kprint orders p42000:2010:2110>:9000(#:: 3Print galactic map 8tempt=tempt+2:g$ BA9 -gy,4*gx-3;1;0;6;"" LG21,0;"Press any key to continue...",:1:0: turn computer on  8000@ hyper-drive etempt=tempt+1:ks=421,0;"Hyper-drive out of order",:1:502: dks>1*10 >121,0;"Hyper-drive out of order",:1:502: Ken20021,0;"Not enough energy",:1:502: &tempt=tempt+1:en=en-200 $n=040(:.02{# =,n:n dgx=(*8)+1:gy=(*8)+1:sx=(*8)+1:sy=(*8)+1  2210  status (damage report) hd=0:n=15:d=d+d(n):n:d21,0;"No damage...",,:1:502: 0,0,,,,,,,,,,,,,,,,,,,,0,0;2;1;13 ;"STATUS",0,,5;"DAMAGE";24;"DELAY",,, m=0:n=15 Ad(n)m=m+1:m;") ";d$(n);" ";:t=d(n):2060 :, n G21,0;"Press any key to continue...",:1:0: SNavigational aid X$1:16,0,,,,,,,, ]tempt=tempt+2 bRa$="Start coordinates: x=":9600%:x1=i:x1<1x1>87010b dRa$="Start coordinates: y=":9600%:y1=i:y1<1y1>87012d l816,0;"Start coordinates (";x1;",";y1;")", vPa$="End coordinates: x=":9600%:x2=i:x2<1x2>87030v xPa$="End coordinates: y=":9600%:y2=i:y2<1y2>87032x );" End coordinates (";x2;",";y2;")",,, Bd=((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)):d=(d*100d)/100d  2670n  "Bearing ";b$;", distance ";d, -21,0;0;"Repeat (Y/N)?"; ""7140 )i$=:i$=""(i$"n"i$"y")7150 "0;i$;:i$="y"7000X  0: lock photon torps  Kks21,0;"No klingons in this sector",:1:502: %tempt=tempt+2 *&n=14:e(n)7240H 4.kpx=1+3*x(n):kpy=(9 -y(n)) >Mm=120:kpy,kpx;(*900+100d):.02{# =,0:m Rn \Jlock=1:21,0;"Torpedoes locked",:1:502: probe sector 5z=21+gx*4+(8-gy)*36$+1 Wg$(z)="0"kse(5)21,0;"Empty sector...",,:1:502: tempt=tempt+2 40,0,,,,,,,,,,,,,,,,,,,,:x1=sx:y1=sy ;1:0,0;1;13 ;"PROBE",:,, -1;"KLINGON BEARING ENERGY TORPS", 0:n=14 =" ";n;:e(n)" --------------------------",:7460$ `x2=x(n):y2=y(n):2670n :" ";b$;" ";e(n),8;8;8;8;p(n), $n .,, 0g$(z)="1"x2=bx:y2=by:2670n :1;" BASE ";0;b$;" ";b(gx,gy),8;8;8;8;8;"N/A", 1e(5)x2=x(5):y2=y(5):2670n :1;"ROMULAN ";0;b$;" ";e(5),8;8;8;8;"0", 8G21,0;"Press any key to continue...",:1:0: Smart-bomb btempt=tempt+2:bomb21,0;"Smart-bomb already used...",:1:502: 6;2;1;s$ Un=115:6:.02{# =,*502:2:.02{# =,*502:n 6;2;s$ (e(5)=0:k1=k1-ks:b1=b1-bs Qx=18:y=18:z=41)+x*3+(8-y)*36$ -s(x,y)=0:s$(zz+2)=" ":y:x Vz=41)+sx*3+(8-sy)*36$:s(sx,sy)=1:s$(zz+2)="" Vz=21+gx*4+(8-gy)*36$:g(gx,gy)=0:g$(zz+2)="000" 0ks=0:n=14:e(n)=0:n 7:bomb=0: sself-destruct sequence xAtempt=tempt+2:0,0;"Self-destruct code?";f$ Qe$f$21,0;"Self-destruct sequence aborted",:1:502: 11 ,0; Wn=100d1-1:ں(n/13 );9 ;n;" ";:.02{# =,60<-n:n %0;7;" ZERO!", "temp=bomb:7610:bomb=temp end=4:8300l ;turn computer off @comp=1-comp J6n=115:.05|L,*20-20:n T "" "" "" "" "" "" "" "" "" "" "" "" "" &"" 0"" :"" D"" N"" X"" l,21,0,,:23692\,255 v 8100 n=119 r$:7;r$, (*8):5 n 2n=122:,,:(*8):7:n 7 !4 2000 !56,0; !6!end=1"Out of energy..." !7end=2"Out of time..." !80end=3"Well done, Mission accomplished" !90end=4"Self-destruct sequence complete" !>18,0;"You had from stardate 000.0", !H)"Until stardate ";:t=t2:2060 :, !R0"To destroy ";k2;" klingon";:k21"s"; !\0b2=1,"There was one base available",,, !f5b21,"There were ";b2;" bases available",,, !p&"By stardate ";:t=t1:2060 :, !z k3=k2-k1 !7"You had destroyed ";k3;" klingon";:k31"s"; !+b2'"And ";b1;" base";:b11"s"; !b2" remained." !score=(100d*k3/k2-b2) !score<0score=0 !4'"Your performance has been rated at ";score;"%"'' ""Another mission (Y/N)?"; """8720" ")i$=:i$=""(i$"y"i$"n")8730" "$ i$="y" ". #( 2000 #2)7,0;"Instructions (Y/N)?"; #<""9020<# #F)i$=:i$=""(i$"y"i$"n")9030F# #Pi$:i$="n" #Z2000:8,10 ;1;"INTRODUCTION";0,,,"Our galaxy is being attacked by a fleet of Klingon warships, andas captain of the USS Enterpriseit is your mission to seek out","and destroy the invaders.",,, #d9900&:i$="e" #n:" 1 2 3 4 5 6 7 8 8 * 8 7 * 7 6 6 5 5 4  4 3 3 2 * * 2 1  1 1 2 3 4 5 6 7 8" #,,"The galaxy is divided into 64","sectors, and a short range scan of the current sector is always shown at the top of the screen.",,, #:" Enterprise"," Klingon"," Starbase"," * Star" #9900&:i$="e" #P2000:,,"Next you are given information on the current situation...",,, #~"SECTOR 3,7CONDITION REDENERGY 1270STARDATE 013.7SHIELDS 357KLINGONS 72TORPEDOES 8COMPUTER OFF",, #""And your command options...",,, #q"1: Manoeuvre5: Scan2: Shields6: Instructions3: Phasers7: Galactic map4: Photon Torps8: Computer",,, #9900&:i$="e" #2000:,,"If there are any Klingons in thesector they will immediately","attack, draining energy from","your shields.",,,,"When your shields go below 0,","energy is taken from your main","energy banks and the Enterprise will be damaged.",,, $Y"When you are given the prompt, Command (1-8)? you may begin to defend yourself...",,, $9900&:i$="e" $02000:,,"MANOUEVRE",,,,"1 unit of Ion drive will take you 1 position across a sector, and Warp factor 1 will take you an entire sector across the","galaxy.",,,,"Directions are always given as","a bearing from 0 to 360 degrees.",,,8;"0"," 270 90",8;8;"180" $"9900&:i$="e" $,u2000:,,"SHIELDS",,,,"You may distribute your energy between the main energy banks and the shields.",, $6,"PHASERS",,,,"Phaser energy is divided betweenthe klingons and the phasers areturned upon each one in turn.","The closer you are, the more","effect your phasers will have." $@9900&:i$="e" $J2000:,,"PHOTON TORPEDOES",,,"The photon torpedoes require a","bearing from 0 to 360 degrees.","They destroy anything except","stars.",,,, $T"LONG RANGE SCAN",,,,"Gives details of the surrounding8 sectors. Each is shown as 3","digits which are the numbers of","Klingons, bases and stars.",,, $^9900&:i$="e" $h2000:,,"INSTRUCTIONS",,,,"Reminds you of the galactic","situation and gives you the","option of reviewing these notes.",, $r"GALACTIC MAP",,,,"Replaces the short range scan","with a map of the entire galaxy.Only sectors you have visited orscanned will be shown.",,, $|9900&:i$="e" $r2000:,,"COMPUTER",,,,"Turns the shipboard computer on,giving you a new set of command options...",,,, $s"1: Hyper-drive5: Probe2: Status6: Smart-bomb3: Navigation7: Self-destruct4: Lock torps8: Control room" $9900&:i$="e" $v2000:,,"HYPER-DRIVE",,,,"Relocates the Enterprise at a","randomly determined position in the galaxy.",,,, $o"STATUS",,,,"Informs you of any damage to theEnterprise and tells you how","long it will take to repair." $9900&:i$="e" $a2000:,,"NAVIGATION",,,,"Gives the bearing and distance","between any two points.",,, $̕"LOCK PHOTON TORPEDOES",,,"After this order has been given,photon torpedoes will not need","bearings, but will home in on","their targets.",,,, $9900&:i$="e" $n2000:,,"PROBE",,,,"Gives details of any Klingons,","bases and Romulans with you in","the sector." $Y,,"SMART-BOMB",,,,"This will destroy everything in a sector, even bases and stars." $9900&:i$="e" ${2000:,,"SELF-DESTRUCT",,,,"Will destroy everything in the","sector including the Enterprise,and end the game." $m,,"CONTROL ROOM",,,,"Switches off the computer and","returns you to the main set of","command options." $9900&:i$="e" %2000:,,"To destroy a Klingon you must","reduce his energy until it is","below 1 unit. Klingons start thegame with 400 units, but half oftheir energy is used each time","they use their own phasers.",,, %"From time to time you will also be attacked by a Romulan. Their vessels possess cloaking deviceswhich make them invisible to","anything other than the probe.","Romulans start with 500 units ofenergy." % 9900&:i$="e" %2000:,,"Docking with starbases will","replenish your energy banks and your stock of photon torpedoes, and repair any damage.",,,"Bases start with 4000 units of energy, and will continue to","manufacture torpedoes until all of this is gone." %9900&:i$="e" %&2000:,,,,1;"These are the voyages of the",,,"Starship ""Enterprise""...",,,"Its five year mission to explore",,"new worlds, to seek out new life",,"and new civiliations, TO BOLDLY",,,"GO WHERE NO MAN HAS GONE BEFORE!" %0G21,0;"Press any key to continue...",:1:0 %: % (a$);b$ %6dec=0:blank=0:num=0:err=0 %n=16 %b$(n)="."decerr=1 %b$(n)="."dec=1 %b$(n)=" "blank=1 %6b$(n)"0"b$(n)"9"num=1:blankerr=1 %8b$(n)"."b$(n)" "(b$(n)<"0"b$(n)>"9")err=1 %n %erri=-1 %&b$=" "err=1:i=-1 % erri=b$ % &421,0;"E to end, SPACE to continue..." &""9910& &i$=:i$=""9920& & '!"STAR TREK"5:9990' ?% 1982. R & R SOFTWARE q STAR TREK }}U the computer program AUTHOR - Jonathan Nixon. X0:7:0:0:0:0:7:::23658j\,0 tg(8,8):s(8,8):b(8,8):s$(357e):b$(6):e$(64@):f$(64@) 0e(5):x(5):y(5):p(5) Id(5):d$(5,16):40(:n=15:d$(n):n (G"Photon torpedoes","Scanners","Ion drive","Warp drive","Phaser banks" 23a="a":60<:n=071G:r:a+n,r:n <0,63?,0,0,0,3,1,0,0,240,128,143,156,254,252,0,0,0,224,252,0,0,0,0 F0,28,31,15,31,62>,62>,0,0,0,128,255,0,0,0,0,0,0,568,252,0,0,0,0 P0,0,0,15,15,0,0,0,0,60<,195,255,255,195,60<,0,0,0,0,240,240,0,0,0 dUg$=22+0+0+23+10 +0+"GALACTIC MAP"+6 ny=81-1 xRg$=g$+20+1+y+20+0+"---:---:---:---:---:---:---:---" y Pg$=g$+20+1+" 1 2 3 4 5 6 7 8 "+20+0 9000(# t2=(*1001)+1000 k1=(*513)+502 b1=(*6)+5 _2000:6,0;" One moment please captain, I'm just creating the universe..." Yx=18:y=18:g(x,y)=(*4)+1:b(x,y)=0:y:x b1=0330J n=1b1 Lx=(*8)+1:y=(*8)+1:g(x,y)10 240 +g(x,y)=g(x,y)+10 :b(x,y)=4000 n n=14 Mx=(*8)+1:y=(*8)+1:g(x,y)400280 "g(x,y)=g(x,y)+400 ,n Jn=17k1 TMx=(*8)+1:y=(*8)+1:g(x,y)300,340T ^g(x,y)=g(x,y)+100d hn  2010 110 ,0;"Acceptable scenario (Y/N)?"; ""410 (i$=:i$=""(i$"y"i$"n")420 i$:i$="y"520 '"Create your own (Y/N)?"; ""450 (i$=:i$=""(i$"y"i$"n")460 i$:i$="n"150 ba$="Target date (100-200)":9600%:t2=(10 *i):t2<1000t2>2000480 Ua$="Klingon force (50-100)":9600%:k1=i:k1<502k1>100d490 Ia$="Bases (0-20)":9600%:b1=i:b1<0b1>20500  190 "Self-destruct code?";e$  2110> &Jw=0:u=0:bax=0:bay=0:t1=0:k2=k1:b2=b1 0Hen=2000:sh=1000:pt=10 :comp=0:bomb=1: :dgx=(*8)+1:gy=(*8)+1:sx=(*8)+1:sy=(*8)+1 N:2210:2470 S tempt=t1 Xdock=0:coms=3 Y2x=sx-1sx+1:y=sy-1sy+1 ZD(sx-x)=(sy-y)x<1x>8y<1y>8609a [s(x,y)3609a \ib(gx,gy)0opop=0:21,0;"Starbase no longer operational",:1:502 ]b(gx,gy)0609a _dock=1:pt=10 :b(gx,gy)=b(gx,gy)+en+sh:en=2000:sh=1000:b(gx,gy)=b(gx,gy)-3000 :n=15:d(n)=0:n `mb(gx,gy)<0b(gx,gy)=b(gx,gy)+en+sh:en=(2*b(gx,gy)/3):sh=b(gx,gy)-en:b(gx,gy)=0 ay:x b 2470 Tt2-t1<2021,0;"Target date approaching...",:1:502 %en0end=1:8300l  t1t2end=2:85004! %k1=0end=3:85004! 821,0,,21,0;"Command (1-8)?"; n=502:key=1 keyƦ""725 -key=0:i$=:i$"1"i$"8"730 #n=n-1:n>0710 key720 5tempt=tempt+2:21,0,,:743 X21,0,,;0,0:g=4800+200*i$:compg=g+1600@ Z0:g:coms=coms-1:2470 :21,0,,:tempt=t1coms700 ogx=baxgy=baybax=0:bay=0:21,0;"Attack on starbase postponed",:1:502 %n=15:d(n)746 d(n)=d(n)-(tempt-t1) Ud(n)0d(n)=0:21,0;d$(n);" REPAIRED",:.2~L,40( n Qkse(5)>0760:katt=katt+1:katt>5katt=1  1280 -n=katt:e(n)>01160:775 /katt=katt+1:katt>5katt=1  760  0n=5osxp(n)ú(*4)1050  s(x(n),y(n))=5  Ix1=x(n):y1=y(n):tx=x1:ty=y1:x2=osx:y2=osy:x1=x2y1=y21050 5(x2-x1)>(y2-y1)ix=(x2-x1):iy=(y2-y1)/(x2-x1)  5(y2-y1)>(x2-x1)iy=(y2-y1):ix=(x2-x1)/(y2-y1) *-(x2-x1)=(y2-y1)ix=(x2-x1):iy=(y2-y1) 4:tx=tx+ix:ty=ty+iy:x1=(tx+.5):y1=(ty+.5) >}x1<1x1>8y1<1y1>8tx=tx-ix:ty=ty-iy:x1=(tx+.5):y1=(ty+.5):c=0:860\ H:s(x1,y1)0s(x1,y1)5c=s(x1,y1):860\ R 8204 \s(x(n),y(n))=2 ^Jc3((x1-x(n))<(osx-x(n)))((y1-y(n))<(osy-y(n)))1050 _kc1c4s(x1,y1)=0:z=41)+x1*3+(8-y1)*36$:s$(zz+2)=" " `c2870f aPk=14:x(k)=x1y(k)=y1e(k)=0:k1=k1-1:ks=ks-1 bk fp(n)=p(n)-1 phedx=20+24*x1:edy=171-8*(9 -y1):epx=1+3*x1:epy=(9 -y1) zBkdx=20+24*x(n):kdy=171-8*(9 -y(n)) ?(edx-kdx)>(edy-kdy)ix=(edx-kdx):iy=(edy-kdy)/(edx-kdx) ?(edy-kdy)>(edx-kdx)iy=(edy-kdy):ix=(edx-kdx)/(edy-kdy) 5(edx-kdx)=(edy-kdy)ix=(edx-kdx):iy=(edy-kdy) B21,0;"Klingon at ";x(n);",";y(n);" firing torpedo", k=08:.01z# =,k*k:k:1:x=kdx:y=kdy:x2=x:y2=y:x,y:0,2:2,0:0,-2:-1,0 Pix=1x=kdxedx4*ix:5785:y=kdy+(x-kdx)*iy:x:960 8y=kdyedy4*iy:5785:x=kdx+(y-kdy)*ix:y zx2,y2:0,2:2,0:0,-2:1;0;0;0;-1,0:0 ʗc>1s$;:epy,epx;1;" ";6;0;1;1;" ";:1;" ":k=110 :.02{# =,(*502)-25:k c=1s$;:epy,epx+1;6;2;1;1;1;" ";:k=110 :.02{# =,(*502)-25:k:21,0;"200 unit hit on shields",:1:502:sh=sh-200:2470 :2590 Ԗc=221,0;"Klingon gunner court-marshalled",:g(gx,gy)=g(gx,gy)-100d:z=21+gx*4+(8-gy)*36$:g$(z)=ks ޽c=321,0;"Starbase destroyed",:b1=b1-1:b(gx,gy)=0:bs=0:g(gx,gy)=g(gx,gy)-10 :z=21+gx*4+(8-gy)*36$:g$(z+1)="0" >c=621,0;"Romulan destroyed",:r=0 9c=421,0;"Torpedo energy absorbed", c11:502  770 e(n)<2770 .pe=(e(n)/2) 3Khe=(3*pe/((sx-x(n))*(sx-x(n))+(sy-y(n))*(sy-y(n)))):he>pehe=pe 4he<1770 5 e(n)=pe 6_n<521,0;"Klingon at ";x(n);",";y(n);" using phasers",:1:502 7Jn=521,0;"Romulan using phasers",:1:502 8hedx=20+24*sx:edy=171-8*(9 -sy):epx=1+3*sx:epy=(9 -sy) Bpkdx=20+24*x(n):kdy=171-8*(9 -y(n)):kpx=1+3*x(n):kpy=(9 -y(n)) LPn<5kdx,kdy:1;6;edx-kdx,edy-kdy:kpy,kpx;1;"" Q4epy,epx;6;2;1;1;"" V%m=17:.01z# =,m*m:m jA21,0;he;" unit hit on shields",:1:502 t"sh=sh-he:2470 :2590 ~2470 :770 e(n)<61210 :x=(*3)-1+x(n):y=(*3)-1+y(n) 5x<1x>8y<1y>81160 s(x,y)1160 s(x(n),y(n))=0:z=41)+x(n)*3+(8-y(n))*36$:s$(zz+2)=" ":x(n)=x:y(n)=y:s(x,y)=2*(n<5)+6*(n=5):e(n)=e(n)-5:n<5z=41)+x*3+(8-y)*36$:s$(zz+2)="":s$:1:502 8n=5e(n)>100dp(n)ź(*3)1270 !x(n)<5x=gx-(*2) !x(n)>4x=gx+(*2) !y(n)<5y=gy-(*2) !y(n)>4y=gy+(*2) x=gxy=gy1210 x<1x=8 x>8x=1 y<1y=8 y>8y=1 g(x,y)4001210 K21,0;"Klingon moving to sector ";x;",";y,:1:502 s(x(n),y(n))=0:z=41)+x(n)*3+(8-y(n))*36$:s$(zz+2)=" ":s$:g(gx,gy)=g(gx,gy)-100d:ks=ks-1:e(n)=0:z=21+gx*4+(8-gy)*36$:g$(z)=((g$(z))-1):g(x,y)=g(x,y)+100d s$  bax1310  bx=(*8)+1:y=(*8)+1:g(x,y)<100db(x,y)(x=gxy=gy)1320( {bax=x:bay=y:21,0;2;7;1;" Starbase ";bax;",";bay;" under attack",:1:75K Qb(bax,bay)=b(bax,bay)-(*1500):b(bax,bay)0b(bax,bay)=0:21,0;2;7;1;" Starbase ";bax;",";bay;" destroyed",:1:502:b1=b1-1:g(bax,bay)=g(bax,bay)-10 :z=21+bax*4+(8-bay)*36$+1:bax=0:bay=0:g$(z)"-"g$(z)="0" "sh<0en=en+sh:sh=0  t1=tempt osx=sx:osy=sy  600X print title Ы:2;" the computer program": print scenario @6,0;"You have until stardate ";:t=t2:2060  1,"To destroy ";k1;" klingon";:k11"s"; 1b11,"There are ";b1;" bases available" ,b1=1,"There is one base available"  print reformatted time  t<10000; t<100d0; *.t/10 ;:t/10 =(t/10 )".0"; 4 9print command options >310 ,0;" CONTROL ROOM COMPUTER",,, H!"1: Manoeuvre Hyper-drive", R"2: Shields Status", \ "3: Phasers Navigation", f "4: Photon Torps Lock torps", p"5: Scan Probe", z "6: Instructions Smart-bomb", #"7: Galactic map Self-destruct", ""8: Computer Control room", H21,0;"Press any key to continue...":1:0:: -21,0;"Entering new sector...", katt=1 initialise sector map Ys$=22+0+0+20+1+" 1 2 3 4 5 6 7 8 " y=81-1 ts$(41)+(8-y)*36$)=y+20+1+" "+20+1+y+" " y 0s$(329I)=" 1 2 3 4 5 6 7 8 " rdock=0:bx=0:by=0:osx=0:osy=0:lock=0:n=14:e(n)=0:n  ss=g(gx,gy) (ks=(ss/100d):ss=ss-100d*ks &bs=(ss/10 ):ss=ss-10 *bs Jz=21+gx*4+(8-gy)*36$:g$(zz+2)=ks+bs+ss <x=18:y=18:s(x,y)=0:y:x $n=15:e(n)=0:n place enterprise Vs(sx,sy)=1:z=41)+sx*3+(8-sy)*36$:s$(zz+2)="" ks=02380L $n=1ks .Lx=(*8)+1:y=(*8)+1:s(x,y)02350. 3place klingon 8s(x,y)=2:z=41)+x*3+(8-y)*36$:s$(zz+2)="":e(n)=400:x(n)=x:y(n)=y:p(n)=3 Bn Lbs=02410j VLx=(*8)+1:y=(*8)+1:s(x,y)02390V [place starbase `js(x,y)=3:bx=x:op=1:by=y:z=41)+x*3+(8-y)*36$:s$(zz+2)="" jss=02460 tn=1ss ~Lx=(*8)+1:y=(*8)+1:s(x,y)02430~ place star Rs(x,y)=4:z=41)+x*3+(8-y)*36$:s$(zz+2)=" * " n (*10 )2460 Lx=(*8)+1:y=(*8)+1:s(x,y)02452 place Romulan Bs(x,y)=6:e(5)=500:x(5)=x:y(5)=y  A2:11 ,0;"SECTOR ";gx;",";gy,"CONDITION "; &dock0;"DOCKED";:2510 5kse(5)2;7;1;"RED";:, 0kse(5)4;0;"GREEN";:, dam=0 /sh<0en=en+sh:sh=0:dam=1 1"ENERGY ";en,"STARDATE ";:t=t1:2060  #,"SHIELDS ";sh,"KLINGONS ";k1, "TORPEDOES ";pt,"COMPUTER "; 1 comp6;0;"ON";:,,,"1: Hyper-drive","5: Probe","2: Status","6: Smart-bomb","3: Navigation","7: Self-destruct4: Lock torps","8: Control room", comp0;"OFF";:,,,"1: Manoeuvre","5: Scan","2: Shields","6: Instructions","3: Phasers","7: Galactic map","4: Photon torps","8: Computer", 0:s$  Damage routine dam (<d1=(*5)+1:d1<1d1>52600( <$d(d1)=d(d1)+(*10 )+10 F;21,0;"Damage to ";d$(d1),:1:502 PT21,0;:t=d(d1):2060 :" stardays to repair",:1:502 d ny1=y2x1=x2b$=" 0.00": xy1=y2x1x2b$="270.00": 1b=(18000PF*((x2-x1)/(y2-y1))/)/100d y2y1x284800 w=i:w<1 Ven20*w21,0;"Not enough energy",:1:502:4800 Fa$="Bearing (0-360)?":9600%:i<0i>360h4820 @b=i*/180:en=(en-20*w):tempt=(tempt+w*8) ox=gx:oy=gy:osx=sx:osy=sy 'c=0:u=8:5060:c &x1=gx*8+osx:y1=gy*8+osy @x2=(.5+x1+8*w*b):y2=(.5+y1+8*w*b) ;x29 x272Hy29 y272H4930B x2<9 x2=64@+x2 $x2>72Hx2=x2-64@ .y2<9 y2=64@+y2 8y2>72Hy2=y2-64@ = 4880 L0gx=(x2/8):gx=x2/8gx=gx-1 V0gy=(y2/8):gy=y2/8gy=gy-1 `sx=x2-8*gx jsy=y2-8*gy ls(osx,osy)=0:z=41)+osx*3+(8-osy)*36$:s$(zz+2)=" ":s(sx,sy)=1:z=41)+sx*3+(8-sy)*36$:s$(zz+2)="" tgxoxgyoy2210 ~ /21,0;"Warp or Ion drive (W/I)?"; ""5010 )i$=:i$=""(i$"w"i$"i")5020 i$="w"4800 $d(3)d1=3:2630F !21,0;"ION DRIVE",,  w=0 @a$="Units (0-8)?":9600%:i<0i>85030 u=i:u<1 Uen5*u21,0;"Not enough energy",:1:502:5028 g21,0;"ION DRIVE",,:a$="Bearing (0-360)?":9600%:i<0i>360h5040 &en=en-(5*u):tempt=(tempt+u) b=i*/180:c=0 Lx1=sx:y1=sy:tx=x1:ty=y1:x2=(.5+x1+u*b):y2=(.5+y1+u*b) B(x2-x1)>(y2-y1)ix=(x2-x1):iy=(y2-y1)/(x2-x1):ct=(x2-x1) B(y2-y1)>(x2-x1)iy=(y2-y1):ix=(x2-x1)/(y2-y1):ct=(y2-y1) :(x2-x1)=(y2-y1)ix=(x2-x1):iy=(y2-y1):ct=(x2-x1) Itx=tx+ix:ty=ty+iy:x1=(tx+.5):y1=(ty+.5):ct=ct-1 9x11x18y11y1851702 w &x1<1gx+ix<1gx=9 &x1>8gx+ix>8gx=0 &y1<1gy+iy<1gy=9 &y1>8gy+iy>8gy=0 =x1<1gx=gx-1:tx=8:x1=tx:x2=x2+8  =x1>8gx=gx+1:tx=1:x1=tx:x2=x2-8 =y1<1gy=gy-1:ty=8:y1=ty:y2=y2+8 =y1>8gy=gy+1:ty=1:y1=ty:y2=y2-8 #sx=x1:sy=y1 (2210:2470 2Ds(x1,y1)>1c=s(x1,y1):he=(u*(i$="i")+10 *w*(i$="w")) <cct>05090 ==ctx=tx-ix:ty=ty-iy:x2=(.5+tx):y2=(.5+ty) >s(sx,sy)=0:z=41)+sx*3+(8-sy)*36$:s$(zz+2)=" ":sx=x2:sy=y2:s(sx,sy)=1:z=41)+sx*3+(8-sy)*36$:s$(zz+2)="":s$ Ac=221,0;"Collision with klingon at ";x1;",";y1,:1:502:n=0:k=14:n=n+k*(x(k)=x1)*(y(k)=y1):k:e(n)=e(n)-he:e(n)0e(n)=0:21,0;"Klingon destroyed",:1:502:k1=k1-1:s(x(n),y(n))=0:z=41)+x(n)*3+(8-y(n))*36$:s$(zz+2)=" ":g(gx,gy)=g(gx,gy)-100d:z=21+gx*4+(8-gy)*36$:ks=ks-1:g$(z)=ks Bc=321,0;"Collision with base at ";x1;",";y1,:1:502:b(gx,gy)=b(gx,gy)-he:b(gx,gy)0b(gx,gy)=0:21,0;"Starbase no longer operational",:1:502:b(gx,gy)=0 Cac=421,0;"Stopped by star at ";x1;",";y1,:1:502:he=he*2 Dc=621,0;"Collision with Romulan at ";x1;",";y1,:1:502:e(5)=e(5)-he:e(5)0e(5)=0:21,0;"Romaulan destroyed",:1:502:s(x(5),y(5))=0 Efcs$;:21,0;he;" units drained from shields",:1:502:sh=sh-he:2590 F P+en=en+sh:sh=0:tempt=tempt+1 Z>a$="Shield energy (0-"+(en-1)+")?":9600%:sh=i d&sh<0sh>en-15210Z n en=en-sh x $d(5)d1=5:2630F Tkse(5)21,0;"No klingons to shoot at",:1:502: Qdock21,0;"You may not attack while docked",:1:502: >a$="Phaser energy (0-"+(en-1)+")?":9600%:pe=i "&pe<0pe>en-15400 'pe=0 (5tempt=tempt+2*ks+2*(e(5)>0) ,Ren=en-pe:pe=(pe/(ks+(e(5)>0))):en=en+pe*(ks+(e(5)>0)) 1hedx=20+24*sx:edy=171-8*(9 -sy):epx=1+3*sx:epy=(9 -sy) 6n=15 @e(n)5520 E en=en-pe Jpkdx=20+24*x(n):kdy=171-8*(9 -y(n)):kpx=1+3*x(n):kpy=(9 -y(n)) NKhe=(3*pe/((sx-x(n))*(sx-x(n))+(sy-y(n))*(sy-y(n)))):he>pehe=pe PZhe=021,0;"Phaser energy too low...",:1:502:5520 T7n<5edx,edy:1;6;kdx-edx,kdy-edy YXepy,epx;1;"":n<5kpy,kpx;6;2;1;1;"" ^%m=17:.01z# =,m*m:m r^n<521,0;he;" unit hit on klingon at ";x(n);",";y(n),:1:502 wLn=521,0;he;" unit hit on Romulan",:1:502 |e(n)=e(n)-he 3n<5e(n)0e(n)=0:21,0;"Klingon destroyed",:1:502:k1=k1-1:s(x(n),y(n))=0:z=41)+x(n)*3+(8-y(n))*36$:s$(zz+2)=" ":g(gx,gy)=g(gx,gy)-100d:z=21+gx*4+(8-gy)*36$:ks=ks-1:g$(z)=ks xn=5e(n)0e(n)=0:21,0;"Romulan destroyed",:1:502:s(x(n),y(n))=0 2470 :n  $d(1)d1=1:2630F Qdock21,0;"You may not attack while docked",:1:502: Gpt21,0;"No torpedoes aboard...",:1:502: lockks5610 *21,0;"Torpedoes locked...", 6f=0:k=14:e(k)ptf5607 k: Ef=1:x1=sx:y1=sy:tx=x1:ty=y1:x2=x(k):y2=y(k):5640  5606 Fa$="Bearing (0-360)?":9600%:i<0i>360h5610 b=i*/180:c=0 Zx1=sx:y1=sy:tx=x1:ty=y1:x2=(.5+x1+15*b):y2=(.5+y1+15*b) $pt=pt-1:tempt=tempt+3  5(x2-x1)>(y2-y1)ix=(x2-x1):iy=(y2-y1)/(x2-x1) 5(y2-y1)>(x2-x1)iy=(y2-y1):ix=(x2-x1)/(y2-y1) -(x2-x1)=(y2-y1)ix=(x2-x1):iy=(y2-y1) &:tx=tx+ix:ty=ty+iy:x1=(tx+.5):y1=(ty+.5) 0c=0:x1<1x1>8y1<1y1>8tx=tx-ix:ty=ty-iy:x1=(tx+.5):y1=(ty+.5):c=1:sx=x1sy=y1c=5 2c5710N :s(x1,y1)>1c=s(x1,y1):c4s(x1,y1)=0:z=41)+x1*3+(8-y1)*36$:s$(zz+2)=" " ?c>15705I D 5670& Ic25710N J]n=14:x(n)=x1y(n)=y1e(n)>0e(n)=0:k1=k1-1:ks=ks-1 Kn N>edx=20+24*sx:edy=171-8*(9 -sy) Xhkdx=20+24*x1:kdy=171-8*(9 -y1):kpx=1+3*x1:kpy=(9 -y1) ]?(kdx-edx)>(kdy-edy)ix=(kdx-edx):iy=(kdy-edy)/(kdx-edx) b?(kdy-edy)>(kdx-edx)iy=(kdy-edy):ix=(kdx-edx)/(kdy-edy) g5(kdx-edx)=(kdy-edy)ix=(kdx-edx):iy=(kdy-edy) ln=08:.01z# =,n*n:n:1:x=edx:y=edy:x2=x:y2=y:x,y:0,2:2,0:0,-2:-1,0 n+c=50:c=1:5760 qQix=1x=edxkdx4*ix:5785:y=edy+(x-edx)*iy:x:5755{ v8y=edykdy4*iy:5785:x=edx+(y-edy)*ix:y {Vx2,y2:0,2:2,0:0,-2:-1,0:0 1c=1s$;:21,0;"Missed...",, c>1s$;:kpy,kpx;1;" ";6;2;1;1;" ";:1;" ":n=110 :.02{# =,(*502)-25:n c=221,0;"Nice shooting, Klingon destroyed":g(gx,gy)=g(gx,gy)-100d:z=21+gx*4+(8-gy)*36$:g$(z)=ks c=321,0;"That wasn't very clever, was it!":b1=b1-1:b(gx,gy)=0:bs=0:g(gx,gy)=g(gx,gy)-10 :z=21+gx*4+(8-gy)*36$:g$(z+1)="0" :c=421,0;"Torpedoe energy absorbed", Rc=621,0;"Well done, Romulan destroyed",:e(5)=0 1:502: qx2,y2:0,2:2,0:0,-2:7;0;0;0;-1,0 ox,y:0,2:2,0:0,-2:6;2;1;1;-1,0 .01z# =,30 x2=x:y2=y: $d(2)d1=2:2630F y0,0,,1,,,,,,,,,,,,,,,,,,:tempt=tempt+2:0,0;8;0;" KBS KBS KBS", Q1:y=gy+1gy-1-1:8;"",8; x=gx-1gx+1 cx1=x+8*(x<1)-8*(x>8):y1=y+8*(y<1)-8*(y>8):a$="" s=g(x1,y1):a$="" s<100da$=a$+"0" s<10 a$=a$+"0"  a$=a$+s Az=21+x1*4+(8-y1)*36$:g$(zz+2)=a$  "";a$;"";  $x:,8;"",:y N0:21,0;"Press any key to continue...",:1:0   kprint orders p42000:2010:2110>:9000(#:: 3Print galactic map 8tempt=tempt+2:g$ BA9 -gy,4*gx-3;1;0;6;"" LG21,0;"Press any key to continue...",:1:0: turn computer on  8000@ hyper-drive etempt=tempt+1:ks=421,0;"Hyper-drive out of order",:1:502: dks>1*10 >121,0;"Hyper-drive out of order",:1:502: Ken20021,0;"Not enough energy",:1:502: &tempt=tempt+1:en=en-200 $n=040(:.02{# =,n:n dgx=(*8)+1:gy=(*8)+1:sx=(*8)+1:sy=(*8)+1  2210  status (damage report) hd=0:n=15:d=d+d(n):n:d21,0;"No damage...",,:1:502: 0,0,,,,,,,,,,,,,,,,,,,,0,0;2;1;13 ;"STATUS",0,,5;"DAMAGE";24;"DELAY",,, m=0:n=15 Ad(n)m=m+1:m;") ";d$(n);" ";:t=d(n):2060 :, n G21,0;"Press any key to continue...",:1:0: SNavigational aid X$1:16,0,,,,,,,, ]tempt=tempt+2 bRa$="Start coordinates: x=":9600%:x1=i:x1<1x1>87010b dRa$="Start coordinates: y=":9600%:y1=i:y1<1y1>87012d l816,0;"Start coordinates (";x1;",";y1;")", vPa$="End coordinates: x=":9600%:x2=i:x2<1x2>87030v xPa$="End coordinates: y=":9600%:y2=i:y2<1y2>87032x );" End coordinates (";x2;",";y2;")",,, Bd=((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)):d=(d*100d)/100d  2670n  "Bearing ";b$;", distance ";d, -21,0;0;"Repeat (Y/N)?"; ""7140 )i$=:i$=""(i$"n"i$"y")7150 "0;i$;:i$="y"7000X  0: lock photon torps  Kks21,0;"No klingons in this sector",:1:502: %tempt=tempt+2 *&n=14:e(n)7240H 4.kpx=1+3*x(n):kpy=(9 -y(n)) >Mm=120:kpy,kpx;(*900+100d):.02{# =,0:m Rn \Jlock=1:21,0;"Torpedoes locked",:1:502: probe sector 5z=21+gx*4+(8-gy)*36$+1 Wg$(z)="0"kse(5)21,0;"Empty sector...",,:1:502: tempt=tempt+2 40,0,,,,,,,,,,,,,,,,,,,,:x1=sx:y1=sy ;1:0,0;1;13 ;"PROBE",:,, -1;"KLINGON BEARING ENERGY TORPS", 0:n=14 =" ";n;:e(n)" --------------------------",:7460$ `x2=x(n):y2=y(n):2670n :" ";b$;" ";e(n),8;8;8;8;p(n), $n .,, 0g$(z)="1"x2=bx:y2=by:2670n :1;" BASE ";0;b$;" ";b(gx,gy),8;8;8;8;8;"N/A", 1e(5)x2=x(5):y2=y(5):2670n :1;"ROMULAN ";0;b$;" ";e(5),8;8;8;8;"0", 8G21,0;"Press any key to continue...",:1:0: Smart-bomb btempt=tempt+2:bomb21,0;"Smart-bomb already used...",:1:502: 6;2;1;s$ Un=115:6:.02{# =,*502:2:.02{# =,*502:n 6;2;s$ (e(5)=0:k1=k1-ks:b1=b1-bs Qx=18:y=18:z=41)+x*3+(8-y)*36$ -s(x,y)=0:s$(zz+2)=" ":y:x Vz=41)+sx*3+(8-sy)*36$:s(sx,sy)=1:s$(zz+2)="" Vz=21+gx*4+(8-gy)*36$:g(gx,gy)=0:g$(zz+2)="000" 0ks=0:n=14:e(n)=0:n 7:bomb=0: sself-destruct sequence xAtempt=tempt+2:0,0;"Self-destruct code?";f$ Qe$f$21,0;"Self-destruct sequence aborted",:1:502: 11 ,0; Wn=100d1-1:ں(n/13 );9 ;n;" ";:.02{# =,60<-n:n %0;7;" ZERO!", "temp=bomb:7610:bomb=temp end=4:8300l ;turn computer off @comp=1-comp J6n=115:.05|L,*20-20:n T "" "" "" "" "" "" "" "" "" "" "" "" "" &"" 0"" :"" D"" N"" X"" l,21,0,,:23692\,255 v 8100 n=119 r$:7;r$, (*8):5 n 2n=122:,,:(*8):7:n 7 !4 2000 !56,0; !6!end=1"Out of energy..." !7end=2"Out of time..." !80end=3"Well done, Mission accomplished" !90end=4"Self-destruct sequence complete" !>18,0;"You had from stardate 000.0", !H)"Until stardate ";:t=t2:2060 :, !R0"To destroy ";k2;" klingon";:k21"s"; !\0b2=1,"There was one base available",,, !f5b21,"There were ";b2;" bases available",,, !p&"By stardate ";:t=t1:2060 :, !z k3=k2-k1 !7"You had destroyed ";k3;" klingon";:k31"s"; !+b2'"And ";b1;" base";:b11"s"; !b2" remained." !score=(100d*k3/k2-b2) !score<0score=0 !4'"Your performance has been rated at ";score;"%"'' ""Another mission (Y/N)?"; """8720" ")i$=:i$=""(i$"y"i$"n")8730" "$ i$="y" ". #( 2000 #2)7,0;"Instructions (Y/N)?"; #<""9020<# #F)i$=:i$=""(i$"y"i$"n")9030F# #Pi$:i$="n" #Z2000:8,10 ;1;"INTRODUCTION";0,,,"Our galaxy is being attacked by a fleet of Klingon warships, andas captain of the USS Enterpriseit is your mission to seek out","and destroy the invaders.",,, #d9900&:i$="e" #n:" 1 2 3 4 5 6 7 8 8 * 8 7 * 7 6 6 5 5 4  4 3 3 2 * * 2 1  1 1 2 3 4 5 6 7 8" #,,"The galaxy is divided into 64","sectors, and a short range scan of the current sector is always shown at the top of the screen.",,, #:" Enterprise"," Klingon"," Starbase"," * Star" #9900&:i$="e" #P2000:,,"Next you are given information on the current situation...",,, #~"SECTOR 3,7CONDITION REDENERGY 1270STARDATE 013.7SHIELDS 357KLINGONS 72TORPEDOES 8COMPUTER OFF",, #""And your command options...",,, #q"1: Manoeuvre5: Scan2: Shields6: Instructions3: Phasers7: Galactic map4: Photon Torps8: Computer",,, #9900&:i$="e" #2000:,,"If there are any Klingons in thesector they will immediately","attack, draining energy from","your shields.",,,,"When your shields go below 0,","energy is taken from your main","energy banks and the Enterprise will be damaged.",,, $Y"When you are given the prompt, Command (1-8)? you may begin to defend yourself...",,, $9900&:i$="e" $02000:,,"MANOUEVRE",,,,"1 unit of Ion drive will take you 1 position across a sector, and Warp factor 1 will take you an entire sector across the","galaxy.",,,,"Directions are always given as","a bearing from 0 to 360 degrees.",,,8;"0"," 270 90",8;8;"180" $"9900&:i$="e" $,u2000:,,"SHIELDS",,,,"You may distribute your energy between the main energy banks and the shields.",, $6,"PHASERS",,,,"Phaser energy is divided betweenthe klingons and the phasers areturned upon each one in turn.","The closer you are, the more","effect your phasers will have." $@9900&:i$="e" $J2000:,,"PHOTON TORPEDOES",,,"The photon torpedoes require a","bearing from 0 to 360 degrees.","They destroy anything except","stars.",,,, $T"LONG RANGE SCAN",,,,"Gives details of the surrounding8 sectors. Each is shown as 3","digits which are the numbers of","Klingons, bases and stars.",,, $^9900&:i$="e" $h2000:,,"INSTRUCTIONS",,,,"Reminds you of the galactic","situation and gives you the","option of reviewing these notes.",, $r"GALACTIC MAP",,,,"Replaces the short range scan","with a map of the entire galaxy.Only sectors you have visited orscanned will be shown.",,, $|9900&:i$="e" $r2000:,,"COMPUTER",,,,"Turns the shipboard computer on,giving you a new set of command options...",,,, $s"1: Hyper-drive5: Probe2: Status6: Smart-bomb3: Navigation7: Self-destruct4: Lock torps8: Control room" $9900&:i$="e" $v2000:,,"HYPER-DRIVE",,,,"Relocates the Enterprise at a","randomly determined position in the galaxy.",,,, $o"STATUS",,,,"Informs you of any damage to theEnterprise and tells you how","long it will take to repair." $9900&:i$="e" $a2000:,,"NAVIGATION",,,,"Gives the bearing and distance","between any two points.",,, $̕"LOCK PHOTON TORPEDOES",,,"After this order has been given,photon torpedoes will not need","bearings, but will home in on","their targets.",,,, $9900&:i$="e" $n2000:,,"PROBE",,,,"Gives details of any Klingons,","bases and Romulans with you in","the sector." $Y,,"SMART-BOMB",,,,"This will destroy everything in a sector, even bases and stars." $9900&:i$="e" ${2000:,,"SELF-DESTRUCT",,,,"Will destroy everything in the","sector including the Enterprise,and end the game." $m,,"CONTROL ROOM",,,,"Switches off the computer and","returns you to the main set of","command options." $9900&:i$="e" %2000:,,"To destroy a Klingon you must","reduce his energy until it is","below 1 unit. Klingons start thegame with 400 units, but half oftheir energy is used each time","they use their own phasers.",,, %"From time to time you will also be attacked by a Romulan. Their vessels possess cloaking deviceswhich make them invisible to","anything other than the probe.","Romulans start with 500 units ofenergy." % 9900&:i$="e" %2000:,,"Docking with starbases will","replenish your energy banks and your stock of photon torpedoes, and repair any damage.",,,"Bases start with 4000 units of energy, and will continue to","manufacture torpedoes until all of this is gone." %9900&:i$="e" %&2000:,,,,1;"These are the voyages of the",,,"Starship ""Enterprise""...",,,"Its five year mission to explore",,"new worlds, to seek out new life",,"and new civiliations, TO BOLDLY",,,"GO WHERE NO MAN HAS GONE BEFORE!" %0G21,0;"Press any key to continue...",:1:0 %: % (a$);b$ %6dec=0:blank=0:num=0:err=0 %n=16 %b$(n)="."decerr=1 %b$(n)="."dec=1 %b$(n)=" "blank=1 %6b$(n)"0"b$(n)"9"num=1:blankerr=1 %8b$(n)"."b$(n)" "(b$(n)<"0"b$(n)>"9")err=1 %n %erri=-1 %&b$=" "err=1:i=-1 % erri=b$ % &421,0;"E to end, SPACE to continue..." &""9910& &i$=:i$=""9920& & '!"STAR TREK"5:9990' ?% 1982. R & R SOFTWARE q