8-Bit Software Online Conversion
:2.$.OilRig2 - Listing
10IF PAGE>&E00 GOTO1460
20MODE7:PROCinit:PROCoil:PROCplayers
30REPEAT
40WEEK%=WEEK%+1
50FORr%=1TOp-1
60MODE2:PROCmap:MODE7:PROCdrill
70IF a=78 THEN 90
80PROCbore(depth%)
90PROCsell:game=FALSE:NEXT
100UNTIL WEEK%>14
110game=TRUE:MODE2:PROCmap:PROCwait(3)
:PROCfill:PROCwait(3):PROCscore
120END
130*****
140DEFPROCinit
150DIM name$(3),cost%(3,14),wk%(3,14),
pl%(3,14),field%(9,13),S$(3,14),tot%(3)
160WEEK%=0:L=RND(-TIME):game=FALSE:r%=
1:ENDPROC
170DEFPROCplayers
180FORs%=1TO2:PRINTTAB(6,s%)CHR$141CHR
$131"HOW MANY PLAYERS (1-4) ?":NEXT:REPE
AT:A=GET:UNTILA>48ANDA<53
190FORp=1TOA-48:PRINT'TAB(4)CHR$(p+128
)"Enter the name of player No. ";p:PRINT
TAB(7)CHR$(p+128)"Maximum of eight lette
rs"
200INPUTTAB(16)name$(p-1):IFLEN(name$(
p-1))>8 name$(p-1)=LEFT$(name$(p-1),8)
210IFLEN(name$(p-1))<1 VDU7,11:GOTO200
220NEXT:ENDPROC
230DEFPROCmap:VDU23;8202;0;0;0;:COLOUR
131:CLS:COLOUR6:PRINTTAB(6,1)"OIL FIELD"
:COLOUR1:FORa%=65TO78:PRINTTAB(a%-62,3)C
HR$a%:NEXT:FORa%=0TO9:PRINTTAB(1,a%+5);a
%TAB(18,a%+5);a%:NEXT:COLOUR7:VDU19,7,3;
0;
240FORa%=3TO16:FORq%=5TO14:PRINTTAB(a%
,q%)CHR$227:NEXT:NEXT
250VDU19,7,7;0;:PROCshow:IF game=TRUE
ENDPROC
260VDU28,1,30,18,16:COLOUR128:CLS:COLO
UR(8+r%):PRINTTAB(9-LEN(name$(r%-1))/2,1
)name$(r%-1)
270COLOUR7:PRINTTAB(2,3)"Enter drillin
g"TAB(3,5)"site details"
280COLOUR5:PRINT''TAB(3)"Letter ";:REP
EAT:P$=GET$:UNTILP$>"@"ANDP$<"O":PRINTP$
:P=ASC(P$):SOUND0,-10,1,5
290COLOUR6:PRINT''TAB(3)"Number ";:REP
EAT:R=GET:UNTILR>47ANDR<58:PRINTCHR$R:SO
UND0,-10,2,5
300IF field%(R-48,P-65)>0 AND field%(R
-48,P-65)<>3 VDU7:CLS:GOTO260
310S$(r%-1,WEEK%-1)=P$+"-"+CHR$R:field
%(R-48,P-65)=field%(R-48,P-65)+2:PROCwai
t(1):ENDPROC
320DEFPROCportfolio:PROCback:FORs%=0TO
1:PRINTTAB(8-LEN(name$(r%-1))DIV2,s%)CHR
$(128+RND(6))CHR$141;name$(r%-1);"'s Por
tfolio WEEK ";WEEK%:NEXT:PRINT
330PRINTTAB(5)"SITE"TAB(14)"COST"TAB(2
2)"WEEKLY"TAB(33)"P/L"
340FORa%=1TOWEEK%:IF cost%(r%-1,a%-1)=
0 THEN PRINTTAB(1,a%+4)CHR$(64+a%)TAB(3,
a%+4)STRING$(37,"*"):PRINTTAB(3,a%+4)" "
:GOTO370
350PROCcalc:pl$=STR$(pl%(r%-1,a%-1)):w
k$=STR$(wk%(r%-1,a%-1))
360PRINTTAB(1,a%+4)CHR$(64+a%)TAB(6,a%
+4)S$(r%-1,a%-1)TAB(13,a%+4);cost%(r%-1,
a%-1)TAB(28-LEN(wk$),a%+4)wk$TAB(38-LEN(
pl$),a%+4);pl$
370NEXT
380PRINTTAB(22)CHR$133"TOTAL £";:IF to
t%(r%-1)<0PRINT;CHR$129;tot%(r%-1)
390IF tot%(r%-1)>=0 THEN PRINT;CHR$130
;tot%(r%-1)
400ENDPROC
410DEFPROCdrill:VDU23;8202;0;0;0;:x%=R
-48:y%=P-65
420IF field%(x%,y%)=1 THEN ch%=90+RND(
9):co%=5000+RND(2000)
430IF field%(x%,y%)=2 THEN ch%=70+RND(
20):co%=3000+RND(2000)
440IF field%(x%,y%)=5 THEN ch%=100:co%
=10000+RND(4000)
450FORj%=6TO7:PRINTTAB(18-LEN(name$(p-
2))/2,j%)CHR$(128+RND(6))CHR$141name$(r%
-1):NEXT
460PRINTTAB(0,10)CHR$131" The chances
of finding oil in this"TAB(11)CHR$131"se
ctor are ";ch%;"%"
470PRINT'CHR$133" The cost of drilling
is £";co%;" per"TAB(11)CHR$133" fifty m
etres."
480PRINT'TAB(8)CHR$136CHR$132"Do you w
ish to drill ?"':PROCv(89,78)
490IFa=78 ENDPROC
500PROCrig:FORbg%=11TO22:PRINTTAB(0,bg
%)CHR$134CHR$157;TAB(39)CHR$156:NEXT
510IF ch%=100 depth%=RND(2)
520IF ch%>97 AND ch%<100 depth%=RND(2)
+1
530IF ch%>94 AND ch%<98 depth%=RND(3)+
1
540IF ch%>88 AND ch%<95 depth%=RND(3)+
2
550IF ch%>79 AND ch%<89 depth%=RND(3)+
3
560IF ch%>69 AND ch%<80 depth%=RND(3)+
4
570IF RND(100)>ch% depth%=8
580ENDPROC
590DEFPROCv(f%,l%):REPEAT:a=GET:UNTILa
=f%ORa=l%:ENDPROC
600DEFPROCsell:VDU26:CLS:PROCportfolio
610IFRND(3)<2ORWEEK%>13PRINTTAB(7,22)C
HR$133"Press any key when ready":A=GET:E
NDPROC
620VDU28,0,23,39,21:CLS:PRINTTAB(5)"Do
you wish to sell any rigs ?":PROCv(78,8
9):IFa=78 PROCtax:ENDPROC
630PRINT'TAB(7)"Which rig will you sel
l ?":REPEAT:g%=GET:UNTIL(g%>64ANDg%<65+a
%-1)
640IF cost%(r%-1,g%-65)=0 VDU7:PRINTTA
B(9)CHR$136CHR$134"NOTHING TO SELL !!!":
GOTO620
650VDU28,0,23,39,0:sp%=(cost%(r%-1,g%-
65)DIV2+cost%(r%-1,g%-65)DIVRND((4)+2))
660PRINTTAB(3,(g%-64)+4)" ";TAB(4,(g%-
64)+4)STRING$(9,"*");" SOLD for £";sp%;"
";STRING$(10,"*")
670cost%(r%-1,g%-65)=0:tot%(r%-1)=tot%
(r%-1)+sp%
680PRINTTAB(19,WEEK%+5)CHR$132CHR$136"
NEW TOTAL £";:IF tot%(r%-1)<0PRINT;CHR$1
29;tot%(r%-1)ELSE PRINT;CHR$130;tot%(r%-
1)
690GOTO620
700PROCtax:ENDPROC
710DEFPROCbore(depth%)
720PRINTTAB(5,11)CHR$130"DEPTH"TAB(27,
11)CHR$129"COST":PROCwait(1):PROCtop
730PRINTTAB(18,11)CHR$131CHR$255CHR$13
4CHR$157:SOUND0,-10,6,3:PROCwait(.7):VDU
28,2,22,38,12,31,0,0
740FORdrill=1TOdepth%:SOUND0,-10,6,3:c
ost%(r%-1,WEEK%-1)=cost%(r%-1,WEEK%-1)+c
o%
750IF drill=1 pt=1 ELSE pt=0
760PRINTTAB(pt)CHR$130;drill*50;" metr
es";TAB(16)CHR$131CHR$255CHR$134CHR$157;
770ct$=STR$(cost%(r%-1,WEEK%-1)):PRINT
TAB(29-LEN(ct$));CHR$129;"£";ct$:PROCwai
t(.7)
780NEXT:pl%(r%-1,WEEK%-1)=-cost%(r%-1,
WEEK%-1)
790vpos=VPOS+12:IF depth%=8 VDU26:PRIN
TTAB(8,20)CHR$132CHR$136"This well is dr
y !!!":PROCwait(3):GOTO830
800VDU26:FORa%=22TOvpos STEP-1:PRINTTA
B(0,a%);CHR$132:PROCwait(.3):NEXT
810PROCspout:wk%(r%-1,WEEK%-1)=cost%(r
%-1,WEEK%-1)DIV depth%+(RND(90)*depth%*9
)
820VDU31,1,vpos+1,131:PRINT"This well
will give a weekly income"TAB(15)CHR$131
"of £";wk%(r%-1,WEEK%-1):PROCwait(4)
830tot%(r%-1)=tot%(r%-1)+(-cost%(r%-1,
WEEK%-1)):IF depth%=8cost%(r%-1,WEEK%-1)
=0
840ENDPROC
850DEFPROCoil
860FORx%=0TO9:FORy%=0TO13:field%(x%,y%
)=FALSE:NEXT:NEXT
870FORa%=0TO39
880x%=RND(10)-1:y%=RND(14)-1:IFfield%(
x%,y%)<>0 THEN880
890field%(x%,y%)=TRUE:NEXT
900FORa%=0TO9
910x%=RND(10)-1:y%=RND(14)-1:IFfield%(
x%,y%)<>0 THEN910
920field%(x%,y%)=3:NEXT
930ENDPROC
940DEFPROCfill
950FORx%=0TO9:FORy%=0TO13
960IF field%(x%,y%)=0ORfield%(x%,y%)=2
THENk%=2
970IF field%(x%,y%)=-1ORfield%(x%,y%)=
1THENk%=0
980IF field%(x%,y%)=3ORfield%(x%,y%)=5
THENk%=9
990COLOURk%:PROCprint:SOUND1,-10,y%*10
,1:PROCwait(.25)
1000NEXT:NEXT:ENDPROC
1010DEFPROCwait(time):ti=TIME+time*100:
REPEAT:UNTILti<TIME:ENDPROC
1020DEFPROCshow
1030FORx%=0TO9:FORy%=0TO13
1040IFfield%(x%,y%)=2 COLOUR2:PROCprint
1050IF field%(x%,y%)=1 COLOUR0:PROCprin
t
1060IF field%(x%,y%)=5 COLOUR9:PROCprin
t
1070NEXT:NEXT:x%=0:y%=0:ENDPROC
1080DEFPROCprint:PRINTTAB(y%+3,x%+5)CHR
$255:ENDPROC
1090DEFPROCcalc:pl%(r%-1,a%-1)=pl%(r%-1
,a%-1)+wk%(r%-1,a%-1)
1100tot%(r%-1)=tot%(r%-1)+wk%(r%-1,a%-1
):ENDPROC
1110DEFPROCback:CLS
1120FORk%=5TO4+WEEK%:PRINTTAB(3,k%)CHR$
148CHR$157CHR$131TAB(10,k%)CHR$147CHR$15
7CHR$132TAB(20,k%)CHR$145CHR$157CHR$135T
AB(29,k%)CHR$146CHR$157CHR$132:NEXT
1130ENDPROC
1140DEFPROCscore:VDU28,1,30,18,16:COLOU
R128:CLS:COLOUR6:PRINTTAB(3,1)"FINAL PRO
FITS"
1150FORsc%=0TOp-2:COLOURsc%+1:PRINTTAB(
1,sc%*2+4)name$(sc%)TAB(9)"£"TAB(10);tot
%(sc%):NEXT
1160*FX210
1170ENDPROC
1180DEFPROCtop
1190FOR de%=1TO10:IFde% DIV 2=0 THEN cr
=125 ELSE cr=230
1200PRINTTAB(19,de%)CHR$(cr):SOUND1,-10
,(10-de%)*5,3:PROCwait(.2):NEXT
1210ENDPROC
1220DEFPROCrig:CLS
1230PRINT"
";
1240PRINT"
";
1250PRINT"
";
1260PRINT"
";
1270PRINT"
";
1280PRINT"
";
1290PRINT"
";
1300PRINT"
";
1310PRINT"
";
1320PRINT"
";
1330PRINT"
"
1340ENDPROC
1350DEFPROCspout
1360vpos1=vpos:FORdpth%=vpos1 TO 11 STE
P-1:PRINTTAB(18,dpth%)CHR$148:PROCwait(.
2):NEXT
1370FORloop%=10TO0 STEP-1:PRINTTAB(4,lo
op%)CHR$148:PROCwait(.2):NEXT
1380PRINTTAB(19,0)CHR$252:SOUND0,1,12,1
:PRINTTAB(18,0)CHR$255TAB(20,0)CHR$255TA
B(17,0)CHR$255TAB(21,0)CHR$255TAB(16,0)C
HR$252TAB(22,0)CHR$252TAB(15,0)CHR$240TA
B(15,1)CHR$175TAB(23,0)CHR$240TAB(23,1)C
HR$175
1390PRINTTAB(14,2)CHR$175TAB(24,2)CHR$1
75:FORl=1TO10:PRINTTAB(RND(13)+4,RND(8)+
2)CHR$255TAB(RND(16)+20,RND(8)+2)CHR$255
:NEXT
1400ENDPROC
1410DEFPROCtax:IF RND(1)<.9 ENDPROC
1420ttl%=tot%(r%-1):IF ttl%<=0 OR ttl%/
20<=0 ENDPROC
1430CLS:PRINTTAB(10)CHR$134CHR$136"TAXE
S NOW DUE.":SOUND0,1,1,1:SOUND1,1,1,1:tx
%=ttl%/20
1440PRINTTAB(11)CHR$129"TAX BILL = £";t
x%:tot%(r%-1)=tot%(r%-1)-tx%
1450IFGET:ENDPROC
1460*K.0*T.|MF.A%=0TO(TOP-PA.)S.4:A%!&E
00=A%!PA.:N.|MPA.=&E00|MO.|MGOTO10|M
1470*FX138,0,128