1070 dim d(5),k1(7),k2(7),k3(7),s(7,7),q(7,7),d$(5) 1080 q$=".EKB*" 1090 d$(0)="WARP ENGINES" 1100 d$(1)="SHORT RANGE SENSORS" 1110 d$(2)="LONG RANGE SENSORS" 1120 d$(3)="PHASERS" 1130 d$(4)="PHOTON TORPEDOES":d$(5)="GALACTIC RECORDS" 1140 input"PLEASE ENTER A RANDOM NUMBER";e$:i=asc(e$) 1150 i=i-11*int(i/11):for j=0 to i:k=rnd:next:print"WORKING-" 1160 deffnd(n)=sqr((k1(i)-s1)^2+(k2(i)-s2)^2) 1170 gosub 1670:gosub 1510:q1=x:q2=y:x=8:y=1:x1=0.2075:y1=6.28:x2=3.28 1180 y2=1.8:a=0.96:c=100:w=10:k9=0:b9=0:s9=400:t9=3451:goto 1200 1190 k=k+(n<x2)+(n<y2)+(n<0.28)+(n<0.08)+(n<0.03)+(n<0.01):k9=k9-k:goto 1220 1200 t0=3421:t=t0:e0=4000:e=e0:p0=10:p=p0:for i=0 to 7 1210 for j=0 to 7:k=0:n=rnd*y:if n<x1 then n=n*64:k=(n<y1)-y:goto 1190 1220 b=(rnd*y>a):b9=b9-b:q(i,j)=k*c+b*w-int(rnd*y*x+y):next j,i 1230 if k9>(t9-t0) then t9=t0+k9 1240 if b9>0 then 1260 1250 gosub 1510:q(x,y)=q(x,y)-10:b9=1 1260 print left$("STARTREK ADAPTED BY L.E. COCHRAN 2/29/76",8):k0=k9 1270 print"OBJECTIVE: DESTROY";k9;"KLINGON BATTLE CRUISERS IN";t9-t0; 1280 print"YEARS.":print" THE NUMBER OF STARBASES IS";b9 1290 a=0:if q1<0 or q1>7 or q2<0 or q2>7 then n=0:s=0:k=0:goto 1310 1300 n=abs(q(q1,q2)):q(q1,q2)=n:s=n-int(n/10)*10:k=int(n/100)
625 :ナイコンさん:2008/09/09(火) 23:02:24
1310 b=int(n/10-k*10):gosub 1510:s1=x:s2=y 1320 for i=0 to 7:for j=0 to 7:s(i,j)=1:next j,i:s(s1,s2)=2 1330 for i=0 to 7:k3(i)=0:x=8:if i<k then gosub 1520:s(x,y)=3:k3(i)=s9 1340 k1(i)=x:k2(i)=y:next:i=s 1350 if b>0 then gosub 1520:s(x,y)=4 1360 if i>0 then gosub 1520:s(x,y)=5:i=i-1:goto 1360 1370 gosub 1610:if a=0 then gosub 1540 1380 if e<=0 then 2430 1390 i=1:if d(i)>0 then 1680 1400 for i=0 to 7:for j=0 to 7:print mid$(q$,s(i,j),1);" ";:next j 1410 print" ";:on i goto 1440,1450,1460,1470,1480,1490,1500 1420 print"YEARS =";t9-t 1430 next:goto 1710 1440 print"STARDATE=";t:goto 1430 1450 print"CONDITION:";c$:goto 1430 1460 print"QUADRANT=";q1+1;"-";q2+1:goto 1430 1470 print"SECTOR =";s1+1;"-";s2+1:goto 1430 1480 print"ENERGY=";e:goto 1430 1490 print d$(4);"=";p:goto 1430 1500 print"KLINGONS LEFT=";k9:goto 1430 1510 x=int(rnd*8):y=int(rnd*8):return 1520 gosub 1510:if s(x,y)>1 then 1520 1530 return 1540 if k<1 then return 1550 if c$="DOCKED" then print"STARBASE PROTECTS ENTERPRISE":return 1560 for i=0 to 7:if k3(i)<=0 then next:return 1570 h=k3(i)*0.4*rnd:k3(i)=k3(i)-h:h=h/(fnd(0)^0.4):e=e-h 1580 e$="ENTERPRISE FROM":n=e:gosub 1590:next:return 1590 print h;"UNIT HIT ON ";e$;" SECTOR";k1(i)+1;"-";k2(i)+1; 1600 print" (";n;"LEFT)":return
626 :ナイコンさん:2008/09/09(火) 23:04:57
1610 for i=s1-1 to s1+1:for j=s2-1 to s2+1 1620 if i<0 or i>7 or j<0 or j>7 then 1640 1630 if s(i,j)=4 then c$="DOCKED":e=e0:p=p0:gosub 1670:return 1640 next j,i:if k>0 then c$="RED" :color 2:return 1650 if e<e0*0.1 then c$="YELLOW":color 6:return 1660 c$="GREEN":color 4:return 1670 for n=0 to 5:d(n)=0:next:return 1680 print d$(i);" DAMAGED."; 1690 print" ";d(i);"YEARS ESTIMATED FOR REPAIR.":print 1700 if a=1 then return 1710 input"COMMAND";a 1720 if a<1 or a>6 then 1740 1730 on a goto 1770,1370,2310,2200,1750,2360 1740 for i=0 to 5:print i+1;"= ";d$(i):next:goto 1710 1750 if d(4)>0 then print"SPACE CRUD BLOCKING TUBES.":i=4:goto 1690 1760 n=15:if p<1 then print"NO TORPEDOES LEFT.":goto 1710 1770 if a=5 then print"TORPEDO "; 1780 input"COURSE (1-8.9)";c:if c<1 then 1710 1790 if c>=9 then 1770 1800 if a=5 then p=p-1:print"TRACK:";:goto 1960 1810 input"WARP (0-12)";w:if w<=0 or w>12 then 1770 1820 if w<=0.2 or d(0)<=0 then 1840 1830 i=0:print d$(i);" DAMAGED, MAX IS 0.2 ";:gosub 1690:goto 1810 1840 gosub 1540:if e<=0 then 2430 1850 if rnd>0.25 then 1930 1860 x=int(rnd*6):if rnd>0.5 then 1890 1870 d(x)=d(x)+int(6-rnd*5):print"**SPACE STORM, "; 1880 print d$(x);" DAMAGED**":i=x:gosub 1690:d(x)=d(x)+1:goto 1930 1890 for i=x to 5:if d(i)>0 then 1920 1900 next
627 :ナイコンさん:2008/09/09(火) 23:06:11
1910 for i=0 to x:if d(i)>0 then next:goto 1930 1920 d(i)=0.5:print"**SPOCK USED A NEW REPAIR TECHNIQUE**" 1930 for i=0 to 5:if d(i)=0 then 1950 1940 d(i)=d(i)-1:if d(i)<=0 then d(i)=0:print d$(i);" ARE FIXED!" 1950 next:n=int(w*8):e=e-n-n+0.5:t=t+1:s(s1,s2)=1 1960 y1=s1+0.5:x1=s2+0.5:if t>t9 then 2430 1970 y=(c-1)*0.785398#:x=cos(y):y=-sin(y) 1980 for i=1 to n:y1=y1+y:x1=x1+x:y2=int(y1):x2=int(x1) 1990 if x2<0 or x2>7 or y2<0 or y2>7 then 2170 2000 if a=5 then print y2+1;"-";x2+1, 2010 if s(y2,x2)=1 then next:goto 2120 2020 print:if a=1 then print"BLOCKED BY "; 2030 on s(y2,x2)-3 goto 2100,2080 2040 print"KLINGON";:if a=1 then 2110 2050 for i=0 to 7:if y2<>k1(i) then 2070 2060 if x2=k2(i) then k3(i)=0 2070 next:k=k-1:k9=k9-1:goto 2130 2080 print"STAR";:if a=5 then s=s-1:goto 2130 2090 goto 2110:2l29e76c 2100 print"STARBASE";:if a=5 then b=2:goto 2130 2110 print" AT SECTOR";y2+1;"-";x2+1:y2=int(y1-y):x2=int(x1-x) 2120 s1=y2:s2=x2:s(s1,s2)=2:a=2:goto 1370 2130 print" DESTROYED!";:if b=2 then b=0:print". . .GOOD WORK!"; 2140 print:s(y2,x2)=1:q(q1,q2)=k*100+b*10+s:if k9<1 then 2460 2150 gosub 1540:if e<=0 then 2430 2160 gosub 1610:goto 1710 2170 if a=5 then print"MISSED!":goto 2150 2180 q1=int(q1+w*y+(s1+0.5)/8):q2=int(q2+w*x+(s2+0.5)/8) 2190 q1=q1-(q1<0)+(q1>7):q2=q2-(q2<0)+(q2>7):goto 1290 2200 i=3:if d(i)>0 then 1680
628 :ナイコンさん:2008/09/09(火) 23:08:16
2210 input"PHASERS READY: ENERGY UNITS TO FIRE";x:if x<=0 then 1710 2220 if x>e then print"ONLY GOT";e:goto 2210 2230 e=e-x:y=k:for i=0 to 7:if k3(i)<=0 then 2290 2240 h=x/(y*(fnd(0)^0.4)):k3(i)=k3(i)-h 2250 e$="KLINGON AT":n=k3(i):gosub 1590 2260 if k3(i)>0 then 2290 2270 print"**KLINGON DESTROYED**" 2280 k=k-1:k9=k9-1:s(k1(i),k2(i))=1:q(q1,q2)=q(q1,q2)-100 2290 next:if k9<1 then 2460 2300 goto 2150 2310 i=2:if d(i)>0 then 1680 2320 print d$(i);" FOR QUADRANT";q1+1;"-";q2+1 2330 for i=q1-1 to q1+1:for j=q2-1 to q2+1:print" "; 2340 if i<0 or i>7 or j<0 or j>7 then print"***";:goto 2410 2350 q(i,j)=abs(q(i,j)):goto 2400 2360 i=5:if d(i)>0 then 1680 2370 print"CUMULATIVE GALACTIC MAP FOR STARDATE:";t 2380 for i=0 to 7:for j=0 to 7:print" "; 2390 if q(i,j)<0 then print"***";:goto 2410 2400 e$=str$(q(i,j)):e$="00"+right$(e$,3):print right$(e$,3); 2410 next j:print:next i:goto 1710 2420 print:print"IT IS STARDATE";t:return 2430 gosub 2420:print"THANKS TO YOUR BUNGLING, THE FEDERATION WILL BE" 2440 print"CONQUERED BY THE REMAINING";k9;"KLINGON CRUISERS!" 2450 print"YOU ARE DEMOTED TO CABIN BOY!":goto 2490 2460 gosub 2420:print"THE FEDERATION HAS BEEN SAVED!" 2470 print"YOU ARE PROMOTED TO ADMIRAL.":print k0;"KLINGONS IN"; 2480 print t-t0;"YEARS. RATING=";int(k0/(t-t0)*1000) 2490 input"TRY AGAIN";e$:if left$(e$,1)="Y" then 1170