home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1985 October / 1985-10.d64 / farmgame (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  11KB  |  316 lines

  1. 10 printchr$(14):bg=127:ch=0:gosub3040
  2. 20 clr:gosub3050:fg=0:printtab(2)"[200]ow long will you":print"manage your farm
  3. 30 [133]qq$:qq[178][197](qq$):[139]qq[178]0[167][141]2870
  4. 40 [139]fg[179][177]0[167]20
  5. 50 [129]zz[178]1[164]qq:[141]2040:[141]2080:[139]zz[178]1[167][141]2130
  6. 60 bg[178]221:ch[178]0:[141]3040
  7. 70 [153]"load(NULL)ear:wait";zz:[153]"(NULL)eason (NULL)election: wait
  8. 80 print"f1 key=[205]arket [206]ews
  9. 90 [153]"f3 key=(NULL)our ascinances
  10. 100 print"f5 key=[208]lanting
  11. 110 [153]"f7 key=(NULL)ell ascutures
  12. 120 print"[215]hat is your choice?
  13. 130 [141]2890
  14. 140 [139][198](a$)[179]133[176][198](a$)[177]136[167]130
  15. 150 aa[178][198](a$)[171]132:[145]aa[141]1110,1330,1480,1830
  16. 160 [139]aa[178]3[167]180
  17. 170 [137]60
  18. 180 bg[178]238:ch[178]1:[141]3040
  19. 190 [153]"load":[153]"(NULL)our crops are growing
  20. 200 fx=0:forj=1to3:fx=fx+(ts(j)*int((bp(j)*fp(j))*100+.5)/100):next
  21. 210 fx=int(fx*100+.5)/100:sb=0
  22. 220 forj=1to3:sb=sr(j)+sb:next
  23. 230 forj=1to3:sr(j)=sr(j)-ts(j):next
  24. 240 gosub2140:gosub2300
  25. 250 gt=0:forj=1to3:gt=gt+ty(j)*int(yp(j)*100+.5)/100:next
  26. 260 pt=0:forj=1to3:pt=(fu(j)*ta(j))+pt:next:pt=int(pt*ga*100+.5)/100
  27. 270 bg=248:ch=0:gosub3040
  28. 280 print"[147]":printtab(2)"   [200]arvest [212]ime   [146]
  29. 290 [141]2960:[153]"  lenropwait  (NULL)ricewait   (NULL)ieldwait
  30. 300 forj=1to3:rr=ta(j):ifrr=0thenrr=1
  31. 310 tm=yp(j):gosub2970:yp$=tm$:yp(j)=val(tm$)
  32. 320 tm=ty(j):gosub2970:ty$=tm$:ty(j)=val(tm$)
  33. 330 printn$(j);tab(8)yp$;:printtab(24-(len(ty$)))int(ty(j)):next
  34. 340 print"[201]t is now time to pay your bills and to sellyour crops.":gosub2880
  35. 350 print"[147][195]urrent [194]ank [194]alance":tm=ba:gosub2970:ba$=tm$:ba=val(tm$)
  36. 360 printtab(10-len(ba$))"$"ba$
  37. 370 print"[198]utures [195]rop [195]heck":tm=fx:gosub2970:fx$=tm$:printtab(10-len(fx$))"$"fx$
  38. 380 print"[212]otal [217]ield":tm=gt:gosub2970:gt$=tm$:gt=val(tm$)
  39. 390 printtab(10-len(gt$))gt$
  40. 400 print"[204]oan [208]ayment [196]ue":tm=int((lo/3)*100+.5)/100:gosub2970
  41. 410 printtab(10-len(tm$))"$"tm$:lp=int(val(tm$)*100+.5)/100
  42. 420 print"[200]arvesting [195]osts":tm=hv:gosub2970:hv$=tm$:printtab(10-len(hv$))"$"hv$
  43. 430 hv=int(val(tm$)*100+.5)/100
  44. 440 print"[195]ost for 200 [193]cres":tm=int(ce*200*100+.5)/100:gosub2970:ce$=tm$
  45. 450 printtab(10-len(ce$))"$"ce$
  46. 460 print"[198]uel [197]xpense":tm=pt:gosub2970:pt$=tm$:pt=int(val(tm$)*100+.5)/100
  47. 470 printtab(10-len(pt$))"$"pt$
  48. 480 print"[207]verhead [197]xpense":tm=ov:gosub2970:ov$=tm$:printtab(10-len(ov$))"$"ov$
  49. 490 ov=int(val(tm$)*100+.5)/100
  50. 500 print"[195]rop [211]torage [198]ees":tm=(12*sb*0.015):gosub2970:sb$=tm$
  51. 510 sb=int(val(tm$)*100+.5)/100
  52. 520 printtab(10-len(sb$))"$"sb$
  53. 530 gosub2880
  54. 540 print"[147][212]otal [193]ssets=[146]":tm=ba+fx+gt:gosub2970:aa$=tm$
  55. 550 printtab(10-len(aa$))"$"aa$
  56. 560 print"[212]otal [196]ebits=[146]"
  57. 570 tm=lp+hv+ov+pt+sb+(ce*200):gosub2970:dt$=tm$:dt=val(tm$)
  58. 580 printtab(10-len(dt$))"$"dt$:gosub2880
  59. 590 forj=1to3:ifty(j)=0then750
  60. 600 print"[147][200]ow many bushels of ":printn$(j);" do you":print"want to sell?
  61. 610 [153]"(NULL)ou have a maximum of ":[153]ty(j)" to sell.
  62. 620 fg=0:x$="":inputx$:ifx$=""then620
  63. 630 ifasc(x$)<48orasc(x$)>57then600
  64. 640 x=val(x$)
  65. 650 ifx>ty(j)then600
  66. 660 printx;"bushels of ":printn$(j);" would sell":print"for $";:tm=x*yp(j):gosub2970
  67. 670 printtm$:gosub2960
  68. 680 print"[201]s ";x;"bushels ok?
  69. 690 [153]"(NULL)ress: f1wait to change":[153]"       f3wait to sell
  70. 700 gosub2890
  71. 710 ifa$=chr$(133)then600
  72. 720 ifa$<>chr$(134)then700
  73. 730 ba=ba+(int(x*yp(j)*100+.5)/100)
  74. 740 sr(j)=int(ty(j)-x+sr(j))
  75. 750 next
  76. 760 ba=int((ba+fx)*100+.5)/100
  77. 770 iflo=0then870
  78. 780 print"[147][200]ow much of your loan do you wish to pay    off?
  79. 790 [153]"(NULL)inimum payment is:"
  80. 800 tm[178][181]((lo[173]3)[172]100[170].5)[173]100:[141]2970:[153][163]3)tm$
  81. 810 [153]"(NULL)ou owe a total of":[153]"$"lo
  82. 820 fg[178]0:[133]a
  83. 830 [139]a[179]tm[167]780
  84. 840 [139]a[177]lo[167]a[178]lo
  85. 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
  86. 860 [139]lo[179]0[167]lo[178]0
  87. 870 ba[178][181]((ba[171](ce[172]200)[171]ov[171]hv[171]pt[171]sb)[172]100)[173]100
  88. 880 [139]ba[179]0[167][141]2560
  89. 890 [129]j[178]1[164]3:ty(j)[178]0:[130]
  90. 900 [129]j[178]1[164]3:ts(j)[178]0:[130]:[130]
  91. 910 [153]"load  valnd of chr$ame (NULL)ally   wait
  92. 920 print"[195]urrent [194]ank [194]alance = $";:tm=ba:gosub2970:printtm$:ba=val(tm$)
  93. 930 gosub2950
  94. 940 print"[195]rops in [211]torage:
  95. 950 [153]" lenrop wait   peekushels wait
  96. 960 xx=0
  97. 970 forj=1to3:ifsr(j)<0thensr(j)=0
  98. 980 printn$(j);tab(10)sr(j):xx=xx+sr(j)*yp(j):next
  99. 990 print"[211]tored crop cash value:$";:tm=xx:gosub2970
  100. 1000 printtm$:xx=val(tm$):ba=ba+xx
  101. 1010 gosub2880:print"[147][193]mount owed to [194]ank:$";:tm=lo:gosub2970
  102. 1020 printtm$:lo=val(tm$):ba=int(ba-lo)
  103. 1030 ifba>=20000thenzz=1
  104. 1040 ifba<20000thenzz=2
  105. 1050 print"[199]rand [212]otal in [194]ank=$";:tm=ba:gosub2970:printtm$:ba=val(tm$):print
  106. 1060 onzzgosub2720,2760
  107. 1070 print"[215]ould you like to try again?
  108. 1080 [141]2890:[139]a$[178]"y"[167]10
  109. 1090 [139]a$[179][177]"n"[167]1080
  110. 1100 [128]
  111. 1110 [153]"load":bg[178]25:ch[178]0:[141]3040
  112. 1120 [153]"     (NULL)val(NULL)(NULL) (NULL)val(NULL)valatn(NULL)val     ":[141]2960
  113. 1130 ir$[178][196]([181]((ir[171]1)[172]100))
  114. 1140 [153]"right$nflation (NULL)ate: ";[163]16)ir$;"%
  115. 1150 tm=ga:gosub2970:ga$=tm$:ga=val(tm$)
  116. 1160 print"[198]uel cost:";tab(16-p)"$"ga$
  117. 1170 tm=hs:gosub2970:hs$=tm$:hs=val(tm$)
  118. 1180 print"[200]erbicide:";tab(16-p)"$"hs$
  119. 1190 tm=is:gosub2970:is$=tm$:is=val(tm$)
  120. 1200 print"[201]nsecticide:";tab(16-p)"$"is$
  121. 1210 tm=ov:gosub2970:ov$=tm$:ov=int(val(tm$)*100+.5)/100
  122. 1220 print"[207]verhead costs:":printtab(16-p)"$"ov$
  123. 1230 tm=ce:gosub2970:ce$=tm$
  124. 1240 print"[195]ost per acre:"tab(15-p)"$"ce$:gosub2880:print"[147]"
  125. 1250 printtab(4)" [211]eed prices "
  126. 1260 print"[199]rain seed cost per   bushel:
  127. 1270 [153]:[129]j[178]1[164]3:[153]n$(j);":";:tm[178]bs(j):[141]2970:bs(j)[178][197](tm$)
  128. 1280 [153][163]15[171]p)"$"tm$:[130]
  129. 1290 [153]" ascutures (NULL)arket (NULL)rice ":[153]
  130. 1300 [129]j[178]1[164]3:[153]n$(j);":";:tm[178]bp(j)[172]fp(j):[141]2970
  131. 1310 [153][163]15[171]p)"$"tm$:[130]:[153]
  132. 1320 [141]2880:[142]
  133. 1330 bg[178]10:ch[178]1:[141]3040
  134. 1340 [153]"load(NULL)our ascinancial (NULL)tatus ":[141]2950
  135. 1350 tm[178]ba:[141]2970:ba[178][197](tm$)
  136. 1360 [153]"(NULL)avings atnccount:":[153][163]15[171]p)"$"ba
  137. 1370 tm[178]lo:[141]2970:lo[178][197](tm$)
  138. 1380 [153]"(NULL)ou owe the bank:"
  139. 1390 [139]lo[178]0[167][153][163]15)"------":[137]1410
  140. 1400 [153][163]15[171]p)"$"tm$
  141. 1410 [141]2950:[153]"   lenrops in (NULL)torage ":[153]:x[178]0
  142. 1420 [153][163]2)"lenrop";[163]14)"peekushels
  143. 1430 forj=1to3:ifsr(j)<1.0thensr(j)=0
  144. 1440 printn$(j);tab(17)sr(j):x=x+sr(j):next
  145. 1450 print"[199]rain [211]torage [198]ee:":print"$";:tm=int(x*.015):gosub2970
  146. 1460 printtm$" per month.
  147. 1470 [141]2880:[142]
  148. 1480 bg[178]29:ch[178]0:[141]3040
  149. 1490 [153]"load     (NULL)lanting (NULL)ime    "
  150. 1500 [153]"(NULL)ou have 200 acres to plant,divided into";
  151. 1510 [153]" 5  fields of 40 acres    each.
  152. 1520 print"[198]ields 1-3 are averageor slightly above     average yielders.
  153. 1530 [153]"ascields 4 and 5 are    slightly less than    average producers.":[141]2880
  154. 1540 [129]j[178]1[164]5:[153]"loadlenrop to be planted in field ";j
  155. 1550 [153][163]5)"1=(NULL)heat   ":[153][163]5)"2=lenorn    wait":[153][163]5)"3=(NULL)oybeanswait
  156. 1560 print"[217]our choice?":gosub2890
  157. 1570 ifasc(a$)<49orasc(a$)>51thengosub2920:goto1560
  158. 1580 fl(j)=val(a$):next
  159. 1590 print"[147][193]ll your fields are   ready for planting.
  160. 1600 [153]"(NULL)ou have:":[129]j[178]1[164]3:x[178]0:[129]jj[178]1[164]5
  161. 1610 [139]fl(jj)[178]j[167]x[178]x[170]40
  162. 1620 [130]:ta(j)[178]x:[153]x;" acres of ";n$(j):[130]
  163. 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
  164. 1640 [153]"(NULL)eed lenosts: ";:[141]2970:tm[178][197](tm$):[153][163]15[171][195](tm$))"$"tm$
  165. 1650 bh[178]ba:[153]"peekank peekalance:":ba[178]ba[171]tm:tm[178]ba:[141]2970
  166. 1660 [153][163]10[171][195](tm$))"$"tm$
  167. 1670 [153]"right$s this okay? ((NULL)/(NULL))
  168. 1680 gosub2890:ifa$="n"thenba=bh:goto1490
  169. 1690 ifa$<>"y"then1680
  170. 1700 print"[147][14