home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1985 October
/
1985-10.d64
/
farmgame
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
11KB
|
316 lines
10 printchr$(14):bg=127:ch=0:gosub3040
20 clr:gosub3050:fg=0:printtab(2)"[200]ow long will you":print"manage your farm
30 [133]qq$:qq[178][197](qq$):[139]qq[178]0[167][141]2870
40 [139]fg[179][177]0[167]20
50 [129]zz[178]1[164]qq:[141]2040:[141]2080:[139]zz[178]1[167][141]2130
60 bg[178]221:ch[178]0:[141]3040
70 [153]"load(NULL)ear:wait";zz:[153]"(NULL)eason (NULL)election: wait
80 print"f1 key=[205]arket [206]ews
90 [153]"f3 key=(NULL)our ascinances
100 print"f5 key=[208]lanting
110 [153]"f7 key=(NULL)ell ascutures
120 print"[215]hat is your choice?
130 [141]2890
140 [139][198](a$)[179]133[176][198](a$)[177]136[167]130
150 aa[178][198](a$)[171]132:[145]aa[141]1110,1330,1480,1830
160 [139]aa[178]3[167]180
170 [137]60
180 bg[178]238:ch[178]1:[141]3040
190 [153]"load":[153]"(NULL)our crops are growing
200 fx=0:forj=1to3:fx=fx+(ts(j)*int((bp(j)*fp(j))*100+.5)/100):next
210 fx=int(fx*100+.5)/100:sb=0
220 forj=1to3:sb=sr(j)+sb:next
230 forj=1to3:sr(j)=sr(j)-ts(j):next
240 gosub2140:gosub2300
250 gt=0:forj=1to3:gt=gt+ty(j)*int(yp(j)*100+.5)/100:next
260 pt=0:forj=1to3:pt=(fu(j)*ta(j))+pt:next:pt=int(pt*ga*100+.5)/100
270 bg=248:ch=0:gosub3040
280 print"[147]":printtab(2)" [200]arvest [212]ime [146]
290 [141]2960:[153]" lenropwait (NULL)ricewait (NULL)ieldwait
300 forj=1to3:rr=ta(j):ifrr=0thenrr=1
310 tm=yp(j):gosub2970:yp$=tm$:yp(j)=val(tm$)
320 tm=ty(j):gosub2970:ty$=tm$:ty(j)=val(tm$)
330 printn$(j);tab(8)yp$;:printtab(24-(len(ty$)))int(ty(j)):next
340 print"[201]t is now time to pay your bills and to sellyour crops.":gosub2880
350 print"[147][195]urrent [194]ank [194]alance":tm=ba:gosub2970:ba$=tm$:ba=val(tm$)
360 printtab(10-len(ba$))"$"ba$
370 print"[198]utures [195]rop [195]heck":tm=fx:gosub2970:fx$=tm$:printtab(10-len(fx$))"$"fx$
380 print"[212]otal [217]ield":tm=gt:gosub2970:gt$=tm$:gt=val(tm$)
390 printtab(10-len(gt$))gt$
400 print"[204]oan [208]ayment [196]ue":tm=int((lo/3)*100+.5)/100:gosub2970
410 printtab(10-len(tm$))"$"tm$:lp=int(val(tm$)*100+.5)/100
420 print"[200]arvesting [195]osts":tm=hv:gosub2970:hv$=tm$:printtab(10-len(hv$))"$"hv$
430 hv=int(val(tm$)*100+.5)/100
440 print"[195]ost for 200 [193]cres":tm=int(ce*200*100+.5)/100:gosub2970:ce$=tm$
450 printtab(10-len(ce$))"$"ce$
460 print"[198]uel [197]xpense":tm=pt:gosub2970:pt$=tm$:pt=int(val(tm$)*100+.5)/100
470 printtab(10-len(pt$))"$"pt$
480 print"[207]verhead [197]xpense":tm=ov:gosub2970:ov$=tm$:printtab(10-len(ov$))"$"ov$
490 ov=int(val(tm$)*100+.5)/100
500 print"[195]rop [211]torage [198]ees":tm=(12*sb*0.015):gosub2970:sb$=tm$
510 sb=int(val(tm$)*100+.5)/100
520 printtab(10-len(sb$))"$"sb$
530 gosub2880
540 print"[147][212]otal [193]ssets=[146]":tm=ba+fx+gt:gosub2970:aa$=tm$
550 printtab(10-len(aa$))"$"aa$
560 print"[212]otal [196]ebits=[146]"
570 tm=lp+hv+ov+pt+sb+(ce*200):gosub2970:dt$=tm$:dt=val(tm$)
580 printtab(10-len(dt$))"$"dt$:gosub2880
590 forj=1to3:ifty(j)=0then750
600 print"[147][200]ow many bushels of ":printn$(j);" do you":print"want to sell?
610 [153]"(NULL)ou have a maximum of ":[153]ty(j)" to sell.
620 fg=0:x$="":inputx$:ifx$=""then620
630 ifasc(x$)<48orasc(x$)>57then600
640 x=val(x$)
650 ifx>ty(j)then600
660 printx;"bushels of ":printn$(j);" would sell":print"for $";:tm=x*yp(j):gosub2970
670 printtm$:gosub2960
680 print"[201]s ";x;"bushels ok?
690 [153]"(NULL)ress: f1wait to change":[153]" f3wait to sell
700 gosub2890
710 ifa$=chr$(133)then600
720 ifa$<>chr$(134)then700
730 ba=ba+(int(x*yp(j)*100+.5)/100)
740 sr(j)=int(ty(j)-x+sr(j))
750 next
760 ba=int((ba+fx)*100+.5)/100
770 iflo=0then870
780 print"[147][200]ow much of your loan do you wish to pay off?
790 [153]"(NULL)inimum payment is:"
800 tm[178][181]((lo[173]3)[172]100[170].5)[173]100:[141]2970:[153][163]3)tm$
810 [153]"(NULL)ou owe a total of":[153]"$"lo
820 fg[178]0:[133]a
830 [139]a[179]tm[167]780
840 [139]a[177]lo[167]a[178]lo
850 ba[178][181]((ba[171]a)[172]100[170].5)[173]100:lo[178](lo[171]a)[172]1.12:lo[178][181](lo[172]100[170].5)[173]100
860 [139]lo[179]0[167]lo[178]0
870 ba[178][181]((ba[171](ce[172]200)[171]ov[171]hv[171]pt[171]sb)[172]100)[173]100
880 [139]ba[179]0[167][141]2560
890 [129]j[178]1[164]3:ty(j)[178]0:[130]
900 [129]j[178]1[164]3:ts(j)[178]0:[130]:[130]
910 [153]"load valnd of chr$ame (NULL)ally wait
920 print"[195]urrent [194]ank [194]alance = $";:tm=ba:gosub2970:printtm$:ba=val(tm$)
930 gosub2950
940 print"[195]rops in [211]torage:
950 [153]" lenrop wait peekushels wait
960 xx=0
970 forj=1to3:ifsr(j)<0thensr(j)=0
980 printn$(j);tab(10)sr(j):xx=xx+sr(j)*yp(j):next
990 print"[211]tored crop cash value:$";:tm=xx:gosub2970
1000 printtm$:xx=val(tm$):ba=ba+xx
1010 gosub2880:print"[147][193]mount owed to [194]ank:$";:tm=lo:gosub2970
1020 printtm$:lo=val(tm$):ba=int(ba-lo)
1030 ifba>=20000thenzz=1
1040 ifba<20000thenzz=2
1050 print"[199]rand [212]otal in [194]ank=$";:tm=ba:gosub2970:printtm$:ba=val(tm$):print
1060 onzzgosub2720,2760
1070 print"[215]ould you like to try again?
1080 [141]2890:[139]a$[178]"y"[167]10
1090 [139]a$[179][177]"n"[167]1080
1100 [128]
1110 [153]"load":bg[178]25:ch[178]0:[141]3040
1120 [153]" (NULL)val(NULL)(NULL) (NULL)val(NULL)valatn(NULL)val ":[141]2960
1130 ir$[178][196]([181]((ir[171]1)[172]100))
1140 [153]"right$nflation (NULL)ate: ";[163]16)ir$;"%
1150 tm=ga:gosub2970:ga$=tm$:ga=val(tm$)
1160 print"[198]uel cost:";tab(16-p)"$"ga$
1170 tm=hs:gosub2970:hs$=tm$:hs=val(tm$)
1180 print"[200]erbicide:";tab(16-p)"$"hs$
1190 tm=is:gosub2970:is$=tm$:is=val(tm$)
1200 print"[201]nsecticide:";tab(16-p)"$"is$
1210 tm=ov:gosub2970:ov$=tm$:ov=int(val(tm$)*100+.5)/100
1220 print"[207]verhead costs:":printtab(16-p)"$"ov$
1230 tm=ce:gosub2970:ce$=tm$
1240 print"[195]ost per acre:"tab(15-p)"$"ce$:gosub2880:print"[147]"
1250 printtab(4)" [211]eed prices "
1260 print"[199]rain seed cost per bushel:
1270 [153]:[129]j[178]1[164]3:[153]n$(j);":";:tm[178]bs(j):[141]2970:bs(j)[178][197](tm$)
1280 [153][163]15[171]p)"$"tm$:[130]
1290 [153]" ascutures (NULL)arket (NULL)rice ":[153]
1300 [129]j[178]1[164]3:[153]n$(j);":";:tm[178]bp(j)[172]fp(j):[141]2970
1310 [153][163]15[171]p)"$"tm$:[130]:[153]
1320 [141]2880:[142]
1330 bg[178]10:ch[178]1:[141]3040
1340 [153]"load(NULL)our ascinancial (NULL)tatus ":[141]2950
1350 tm[178]ba:[141]2970:ba[178][197](tm$)
1360 [153]"(NULL)avings atnccount:":[153][163]15[171]p)"$"ba
1370 tm[178]lo:[141]2970:lo[178][197](tm$)
1380 [153]"(NULL)ou owe the bank:"
1390 [139]lo[178]0[167][153][163]15)"------":[137]1410
1400 [153][163]15[171]p)"$"tm$
1410 [141]2950:[153]" lenrops in (NULL)torage ":[153]:x[178]0
1420 [153][163]2)"lenrop";[163]14)"peekushels
1430 forj=1to3:ifsr(j)<1.0thensr(j)=0
1440 printn$(j);tab(17)sr(j):x=x+sr(j):next
1450 print"[199]rain [211]torage [198]ee:":print"$";:tm=int(x*.015):gosub2970
1460 printtm$" per month.
1470 [141]2880:[142]
1480 bg[178]29:ch[178]0:[141]3040
1490 [153]"load (NULL)lanting (NULL)ime "
1500 [153]"(NULL)ou have 200 acres to plant,divided into";
1510 [153]" 5 fields of 40 acres each.
1520 print"[198]ields 1-3 are averageor slightly above average yielders.
1530 [153]"ascields 4 and 5 are slightly less than average producers.":[141]2880
1540 [129]j[178]1[164]5:[153]"loadlenrop to be planted in field ";j
1550 [153][163]5)"1=(NULL)heat ":[153][163]5)"2=lenorn wait":[153][163]5)"3=(NULL)oybeanswait
1560 print"[217]our choice?":gosub2890
1570 ifasc(a$)<49orasc(a$)>51thengosub2920:goto1560
1580 fl(j)=val(a$):next
1590 print"[147][193]ll your fields are ready for planting.
1600 [153]"(NULL)ou have:":[129]j[178]1[164]3:x[178]0:[129]jj[178]1[164]5
1610 [139]fl(jj)[178]j[167]x[178]x[170]40
1620 [130]:ta(j)[178]x:[153]x;" acres of ";n$(j):[130]
1630 tm[178]0:[129]j[178]1[164]3:tm[178]tm[170](ta(j)[172]bs(j)[172]bb(j)):[130]:tm[178][181]((tm[170].005)[172]100)[173]100
1640 [153]"(NULL)eed lenosts: ";:[141]2970:tm[178][197](tm$):[153][163]15[171][195](tm$))"$"tm$
1650 bh[178]ba:[153]"peekank peekalance:":ba[178]ba[171]tm:tm[178]ba:[141]2970
1660 [153][163]10[171][195](tm$))"$"tm$
1670 [153]"right$s this okay? ((NULL)/(NULL))
1680 gosub2890:ifa$="n"thenba=bh:goto1490
1690 ifa$<>"y"then1680
1700 print"[147][14