home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Light
/
Light_Vol.1_August_1992_Datasphere_Publications_Disk_1_of_2_Side_A.d64
/
miner
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
10KB
|
267 lines
10 poke51,52:poke52,52:poke55,52:poke56,52:g=g+1:ifg=1thenload"tn.chr",8,1
20 poke53280,0:poke53281,0:gosub2550:gosub2450
30 print"[147]";x$(1)"[199][153] galaxy ore mining corporation [200]";
40 print"[199][153] supervisors report for [200]";:printx$(2);
50 print"";x$(3):printx$(4):printx$(5):printx$(4):printx$(6):printtp$;x$(7)
60 printx$(8):printx$(9):printx$(8):printx$(9):printx$(8):printx$(10):gosub2180
70 fg=1:iftc=1andy=ethengosub2100
80 rs=int(rnd(1)*3)+1:ifrs=3thengosub1740
90 ifcr<800ands>1000thengosub1600
100 ifcr<1then1000
110 c=int(rnd(18)*9)+18:mp=c
120 x=0:pokev,18:printu$:pokeh,1:print"[154]how many mines would you like to close"
130 print"this month at"mp"credits a mineshaft":input"";x
140 x=int(x)
150 ifpeek(200)=3then120
160 ifx=0thengosub1700:goto220
170 ifx<tmthengosub1700:goto210
180 gosub1700
190 pokev,18:printu$:pokeh,1:print"[159]supervisor..you only have"tm"mines"
200 print"try closing a few less":gosub2140:gosub1700:goto120
210 tm=tm-x:cr=cr+mp*x:gosub2280:gosub2400:goto340
220 c=int(rnd(18)*9)+18:mp=c
230 x=0:pokev,18:printu$:pokeh,1:print"[154]how many new mines will you open this"
240 print"month at"mp"credits a mineshaft":input"";x
250 x=int(x)
260 ifpeek(200)=3then230
270 ifx=0thengosub1700:goto340
280 ifmp*x<=crthengosub1700:goto330
290 gosub1700:ifcr<1then1000
300 pokev,18:printu$:pokeh,1:print"[158]supervisor, there is only sufficient"
310 pokev,19:printu$:pokeh,1:print"funds to purchase";int(cr/mp);"mines"
320 gosub2140:gosub1700:goto230
330 tm=tm+x:cr=cr-mp*x:gosub2280:gosub2400
340 f=0:pokev,18:printu$:pokeh,3:print"[152]how many credits will you spend to"
350 print"feed the workforce this month":input"";f
360 f=int(f)
370 iff=0thengosub1700:goto340
380 iff<=crthengosub1700:cr=cr-f:goto430
390 gosub1700:ifcr<1then1000
400 pokev,18:printu$:pokeh,1:print"[158]such generosity but you only have"cr
410 pokev,19:printu$:pokeh,1:print"credits available supervisor"
420 gosub2140:gosub1700:goto340
430 gosub2400
440 d=wf-int(f/10):i=0:ifd>0then460
450 i=-d/2:d=0
460 mw=0:pokev,18:printu$:pokeh,3:print"[159]how many mines will be worked this"
470 print"month supervisor ?":input"";mw
480 mw=int(mw)
490 ifmw=0then460
500 ifmw<=tmthen540
510 gosub1700
520 pokev,18:printu$:pokeh,1:print"[159]imaginative thinking sir but we only"
530 print"have"tm"mineshafts":gosub2140:gosub1700:goto460
540 ifint(mw/2)<=crthen650
550 gosub1700
560 pokev,17:printu$:pokeh,2:print"[152]credits have been deducted to be able"
570 ch=int(rnd(1)*3)+1:onchgoto580,590,600
580 print"to purchase some new mine equipment.":goto610
590 print"to improve the mine safety equipment.":goto610
600 print"to make repairs to mine equipment."
610 sb=int(cr/3):sb=int(sb)
620 ifsb>1thenprint"only[158]"sb"[152]mines can be worked":goto640
630 ifsb=1thenprint"only[158] 1 [152]mine can be worked"
640 mw=sb:cr=cr-sb-10:gosub2400:gosub2140:gosub1700:goto700
650 ifmw<=10*wfthen700
660 gosub1700
670 pokev,18:printu$:pokeh,1:print"[159]supervisor,one worker can only operate"
680 print"ten mines. we can operate a maximum of":mw=10*wf:printmw"mines"
690 gosub2430:gosub1700:goto460
700 c=int(rnd(1)*5)+1:m=mw*c:bn=int(rnd(1)*70)+1:ifbn>60thengosub1390
710 ifbn>50andbn<60ands>2000thengosub1470
720 q=rnd(1)*3+1
730 ifint(q/2)<>q/2then750
740 k=int(s/q)
750 s=s-k+m:gosub2360:ifs>99000thengoto1280
760 i=int(c*(20*tm+s)/wf/100+1):gosub2320:wf=wf+i
770 q=int(f/10):dp=int(rnd(1)*3)+1
780 ifwf<qthend=dp:goto850
790 d=wf-q:gosub2380:cp=cp+d:ifd>.5*wfthen880
800 ifd>.35*wfthen830
810 ifd>.2*wfthen1360
820 iflc=4then880
830 wf=q
840 ifcr>400*wfthen1090
850 e=e+3:ife=37thenyr=yr+1:e=1:lc=0
860 ife<37thengosub1700
870 gosub2340:gosub2250:mt=mt+1:goto70
880 print"[147][150]"cp"people have died of malnutrition":k$="month"
890 print"and other related diseases since you":ifmt<>1thenk$=k$+"s"
900 print"took over here"mt;k$;" ago."
910 ifsl>0thenprint""sl"workers have been lost to slavery."
920 forw=1to1000:next:print,,"[157][157][157][157][157]_ _ _":forw=1to1000:next
930 print"you have been assasinated by a member"
940 print"of the workforce because of your poor"
950 print"leadership qualities."
960 print"try again with a fresh supervisor (y/n)":gosub2140
970 ifa$="n"thensys64738
980 ifa$="y"thengosub2440:goto30
990 ifa$<>"n"ora$<>"y"then880
1000 print"[147][153]you are stoney broke !!! you had"
1010 print"the means to further your career"
1020 print"with the company and you blew it."
1030 print"it might be best if you were on"
1040 print"the next ship out of here."
1050 print"try again with a fresh supervisor (y/n)":gosub2140
1060 ifa$="n"thensys64738
1070 ifa$="y"thengosub2440:goto30
1080 ifa$<>"n"ora$<>"y"then1000
1090 print"[147][154]you have decided to take the soft"
1100 print"option and leg it off the planet"
1110 print"with the company safe amongst your"
1120 print"luggage.":print"the safe contains a total of"cr
1130 print"credits and some gold and silver"
1140 print"which you 'creamed' off for just"
1150 print"such an occasion."
1160 print"try again with a fresh supervisor (y/n)":gosub2140
1170 ifa$="n"thensys64738
1180 ifa$="y"thengosub2440:goto30
1190 ifa$<>"n"ora$<>"y"then1090
1200 print"[147][155]i don't know how you did it but you"
1210 print"have managed to close down the entire"
1220 print"operation all by your self."
1230 print"move over and let someone else have ago."
1240 print"[152]try again with a fresh supervisor (y/n)":gosub2140
1250 ifa$="n"thensys64738
1260 ifa$="y"thengosub2440:goto30
1270 ifa$<>"n"ora$<>"y"then1200
1280 print"[147][159]there isn't room to store any more"
1290 print"ore. the markets have stopped buying"
1300 print"because of a glut."
1310 print"go on vacation until things improve."
1320 print"[152]try again with a fresh supervisor (y/n)":gosub2140
1330 ifa$="n"thensys64738
1340 ifa$="y"thengosub2440:goto30
1350 ifa$<>"n"ora$<>"y"then1280
1360 lc=lc+1:gosub1700
1370 pokev,18:printu$:pokeh,1:print"[150]be warned !! the workers are hungry"
1380 print"and there is talk of rebellion.":gosub2430:gosub1700:goto830
1390 x=int(rnd(1)*4)+1:bc=mw*x+300:gosub1700
1400 ifx=1thenbn$="tin":goto1440
1410 ifx=2thenbn$="copper":goto1440
1420 ifx=3thenbn$="silver":goto1440
1430 ifx=4thenbn$="gold"
1440 pokev,18:printu$:pokeh,1:print"[158]bonus! we have found a vein of "bn$
1450 o$="credit":ifbb<>1theno$=o$+"s"
1460 print"this is worth"bc;o$:cr=cr+bc:gosub2430:gosub2400:return
1470 x=int(rnd(1)*3)+1:gosub1700
1480 ifx=1thensh$="cargo tug"
1490 ifx=2thensh$="freighter"
1500 ifx=3thensh$="ore carrier"
1510 x=x+2:pokev,18:printu$:pokeh,1:print"[158]supervisor, a passing "sh$" has"
1520 print"hailed us and enquires if we wish to"
1530 print"sell some stock. the captain has room"
1540 os=rnd(1)*(1500-500)+500:os=int(os):print"for"os"tons at"x"credits a ton"
1550 print"shall i sell at that price ? y/n ?"
1560 gosub2140:ifa$="n"thengosub1700:return
1570 ifa$="y"thencr=cr+os*x:ms=ms+os:s=s-os:gosub2300:gosub2360:gosub2400
1580 ifa$="y"thengosub1700:return
1590 ifa$<>"n"ora$<>"y"thengosub1700:goto1470
1600 rn=int(rnd(100)*2000)+1:pd=int(rnd(1)*4)+1:os=int(rnd(1)*600)+rn
1610 pokev,18:printu$:pokeh,1:print"[158]i have called the federation markets"
1620 print"who require"os"tons of ore."
1630 o$="credit":ifpd<>1theno$=o$+"s"
1640 print"they will pay"pd;o$" a ton. shall i"
1650 print"sell at that price ? y/n ?"
1660 gosub2140:ifa$="n"thengosub1700:return
1670 ifa$="y"thencr=cr+os*pd:ms=ms+os:s=s-os:gosub2300:gosub2360:gosub2400
1680 ifa$="y"thengosub1700:return
1690 ifa$<>"n"ora$<>"y"thengosub1700:goto1610
1700 w=17:forxw=1to8
1710 pokev,w:printu$:pokeh,0:print" "
1720 w=w+1:ifw<25thennext
1730 return
1740 rg=int(rnd(1)*5)+1:onrggoto1750,1900,1750,1900,1750
1750 iftm<=1then1200
1760 x=int(rnd(1)*4)+1:gosub2080
1770 ifx=1thenap$="hill":goto1810
1780 ifx=2thenap$="river":goto1810
1790 ifx=3thenap$="desert":gp=int(rnd(1)*wf/5)+2:wf=wf-gp:gosub2340:goto1810
1800 ifx=4thenap$="plains":ge=int(rnd(1)*100)+1:cr=cr-ge:gosub2400
1810 pokev,18:printu$:pokeh,2:print"[150]we have been attacked by one of the"
1820 print""ap$" tribes."dn"workers are dead."
1830 ifx=1orx=2thengosub2140:goto1890
1840 ifx=3thenprint""gp"of our people have been taken as"
1850 ifx=3thenprint"slaves":sl=sl+gp:gosub2140:goto1890
1860 ifx=4thenprint"[152]vital equipment has been taken to the"
1870 ifx=4thenprint"value of"ge"credits. your account"
1880 ifx=4thenprint"has been debited for this amount.":gosub2140
1890 gosub1700:return
1900 iftm<=1then1200
1910 x=int(rnd(1)*4)+1:gosub2080
1920 ifx=1thenap$=" serious fire":goto1960
1930 ifx=2thenap$=" heavy flood":goto1960
1940 ifx=3thenap$="n explosion":goto1960
1950 ifx=4thenap$=" bad cave-in"
1960 pokev,18:printu$:pokeh,2:print"[150]there has been a"ap$" at a"
1970 print"mine in sector"sk"[157]-"sr
1980 print""dn"workers are dead or injured."
1990 ifx=1orx=2andcm=1orcm=3then2030
2000 ifx=1orx=2andcm=2orcm=4then2060
2010 ifx=3orx=4andcm=1orcm=3then2030
2020 ifx=3orx=4andcm=2orcm=4then2060
2030 iftc=1then2060
2040 iftc=0thenprint"[159]mine is closed for repairs.":y=int(rnd(1)*6)*6+1:tc=1
2050 iftc=1thentm=tm-1:gosub2140:goto2070
2060 print"[159]mine is closed permanently.":tm=tm-1:gosub2140
2070 gosub2280:gosub1700:return
2080 tp=wf:dn=int(rnd(1)*tp/4)+2:wf=wf-dn:d=dn:md=int(rnd(1)*tm/4)+1:gosub2340
2090 sk=int(rnd(1)*50)+1:sr=int(rnd(1)*80)+1:cm=int(rnd(1)*4)+1:gosub2380:return
2100 pokev,18:printu$:pokeh,4:print"[159]damaged mine has been repaired at"
2110 mr=int(cr/6):mr=int(mr)
2120 print"a cost of"mr"credits":tc=0:tm=tm+1
2130 cr=cr-mr:gosub2400:gosub2280:gosub2140:gosub1700:return
2140 rp=23:forpl=0to14step1:pe$=right$(pk$,pl+1)
2150 print"[153]"tab(pl)right$(v$,rp)" "pe$:next
2160 geta$:ifa$=""then2160
2170 ifa$<>""thenreturn
2180 pokev,6:printu$:pokeh,2:print"[159]^ workforce"
2190 pokev,6:printu$:pokeh,21:print"[150]_ fatalaties"
2200 pokev,8:printu$:pokeh,2:print"[159]total mines"
2210 pokev,8:printu$:pokeh,21:print"[150]^ immigrants"
2220 pokev,11:printu$:pokeh,10:print"[158]mineral tons in silos"
2230 pokev,13:printu$:pokeh,10:print"[158]minerals shipped to date"
2240 pokev,15:printu$:pokeh,10:print"[152]credits available"
2250 forw=1to7:pokev,3:printu$:pokeh,28:print"[154]"mid$(dt$,e,3);yr
2260 pokev,3:printu$:pokeh,28:print""mid$(dt$,e,3);yr;"[146]":next
2270 pokev,3:printu$:pokeh,28:print"[153]"mid$(dt$,e,3);yr
2280 pokev,8:printu$:pokeh,14:print" [159]"
2290 pokev,8:printu$:printtab(20-len(str$(tm)))tm:iffg=1thenreturn
2300 pokev,13:printu$:printtab(2)" [158]"
2310 pokev,13:printu$:printtab(8-len(str$(ms)))ms:iffg=1thenreturn
2320 pokev,8:printu$:printtab(35)" [150]"
2330 pokev,8:printu$:printtab(38-len(str$(i)))i:iffg=1thenreturn
2340 pokev,6:printu$:printtab(15)" [159]"
2350 pokev,6:printu$:printtab(20-len(str$(wf)))wf:iffg=1thenreturn
2360 pokev,11:printu$:pokeh,2:print" [158]"
2370 pokev,11:printu$:printtab(8-len(str$(s)))s:iffg=1thenreturn
2380 pokev,6:printu$:printtab(35)" [150]"
2390 pokev,6:printu$:printtab(38-len(str$(d)))d:iffg=1thenreturn
2400 pokev,15:printu$:pokeh,2:print" [152]"
2410 pokev,15:printu$:printtab(8-len(str$(cr)))cr:iffg=1thenreturn
2420 return
2430 forw=1to3000:next:return
2440 i=0:ms=0:s=0:d=0:cp=0:fg=0:tc=0:gosub2550:return
2450 print"[147]":poke53272,31:a=1
2460 m$="[159] shadow graphics":j=11:gosub2510
2470 m$="[129] presents":j=15:gosub2510
2480 m$=" maurice miner":j=12:gosub2510
2490 m$="[159]@ shadow graphics 1992":j=9:gosub2510
2500 gosub2430:return
2510 fort=1to24step1
2520 ms$=left$(m$,1+t)
2530 print""tab(j)left$(v$,a+10);ms$
2540 forw=1to15:nextw,t:a=a+2:return
2550 x$(1)="[213][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][201]":tp$="":wf=100
2560 dt$="janfebmaraprmayjunjulaugsepoctnovdec":e=1:pk$="press a key"
2570 x$(2)="[202][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][203]":u$="[145][145]":h=211:v=214:d=0
2580 x$(3)=" [176][175][175][175][175][175][175][175][175][175][175][175][178][175][175][175][175][175][175][178][175][175][175][175][175][175][175][175][175][175][175][175][175][178][175][175][175][174]":tm=rnd(1)*(1010-990)+990
2590 x$(4)=" [199] [200] [200] [200] [200]":tm=int(tm):cr=1000:yr=2050
2600 x$(5)=" [171][175][175][175][175][175][175][175][175][175][175][175][219][175][175][175][175][175][175][219][175][175][175][175][175][175][175][175][175][175][175][175][175][219][175][175][175][179]"
2610 x$(6)=" [173][172][172][172][172][172][172][172][172][172][172][172][177][172][172][172][172][172][172][177][172][172][172][172][172][172][172][172][172][172][172][172][172][177][172][172][172][189]"
2620 x$(7)=" [176][175][175][175][175][175][175][178][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][174]"
2630 x$(8)=" [199] [200] [200]"
2640 x$(9)=" [171][175][175][175][175][175][175][219][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][179]"
2650 x$(10)=" [173][172][172][172][172][172][172][177][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][172][189]"
2660 v$="":return