home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1992 June / 1992-06.d64 / stock market 64 (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1992-01-01  |  9.2 KB  |  244 lines

  1. 0 clr
  2. 100 rem copyright 1992 compute publications intl ltd - all rights reserved
  3. 110 goto240
  4. 120 print"":s=7:ifp=2thens=24
  5. 130 printleft$("",z+1)mid$(c$,z+1,1)spc(s);
  6. 140 o=usr(bg(z,p)),4,0,0:print" ";:o=usr(tv(z,p)),10,2,2:print
  7. 150 print"";:s=9:ifp=2thens=26
  8. 160 printspc(s)"[155]";:vx=tw(p):pu=usr(vx),13,2,3:print
  9. 170 printspc(s)"[153]";:vx=ch(p):pu=usr(vx),13,2,3:print
  10. 180 printspc(s)"[158]";:vx=ft(p):pu=usr(vx),13,2,3:print"":return
  11. 190 sv(z)=int(sv(z)*100)/100:print""left$("",z+1);
  12. 200 ll=int(sv(z)/3.4+sgn(sv(z))):printmid$(c$,z+1,1)sk$(z)"  ";left$(b$,ll);
  13. 210 printleft$("                        ",25-ll);:ifsv(z)=0thenprint" ";
  14. 220 pu=usr(sv(z)),6,2,1:print
  15. 230 return
  16. 240 gosub1860
  17. 250 gosub1620
  18. 260 jy=peek(j1)and16:ifjy>0thenjy=peek(j2)and16
  19. 270 j=1:geta$:if(a$>"")orjy=0then360
  20. 280 ifch(j)<0thenpn=2:goto520
  21. 290 j=j+1:ifj<3then280
  22. 300 gosub1840:gosub840:gosub1100
  23. 310 ifyr<239then260
  24. 320 fori=0to10:sys49504:fory=0to75:next:printspc(136)"[150][212][193][216] [212][201][205][197]!"
  25. 330 fory=0to75:next:next
  26. 340 poke53281,15:poke53280,15:gosub1330:poke53281,0:poke53280,6:gosub1620
  27. 350 yr=0:goto260
  28. 360 ifa$<>"p"then390
  29. 370 poke53281,11:poke53280,11:poke198,0:wait198,1:poke198,0
  30. 380 poke53280,6:poke53281,0:goto260
  31. 390 if(a$<>" "anda$<>chr$(13))and(jy>0)then260
  32. 400 sys49504
  33. 410 print""spc(12)"[158][208]layer 1 or 2":printspc(12)"[210][197][212][213][210][206][146] to game"
  34. 420 poke198,0:wait198,1:geta$:poke198,0
  35. 430 ifa$=chr$(13)thengosub1620:goto260
  36. 440 ifa$<"1"ora$>"2"then420
  37. 450 j=val(a$)
  38. 460 sys49504:print"[158]"spc(53)"1. [194]uy"
  39. 470 printspc(53)"2. [211]ell"
  40. 480 printspc(53)"[210][197][212][213][210][206][146] to menu"
  41. 490 poke198,0:wait198,1:geta$:poke198,0:pn=val(a$)
  42. 500 ifa$=chr$(13)then400
  43. 510 ifa$<"1"ora$>"2"then490
  44. 520 on pn gosub540,680
  45. 530 goto360
  46. 540 sys49504:print""spc(8)"[159] [194]uy [207]ptions- [158][208]layer"j
  47. 550 print:fori=0to5:printmid$(c$,i+1,1)i+1"[157]. "sk$(i)" ";
  48. 560 o=usr(bg(i,j)),5,0,0:print" ";:o=usr(tv(i,j)),15,2,3:print:next
  49. 570 print" [195]ash on [200]and:   ";:o=usr(ch(j)),15,2,3:print
  50. 580 printhc$"";:fori=0to39:printchr$(20);:next:print" [194]uy which stock (1-6)"
  51. 590 poke198,0:wait198,1:geta$:poke198,0
  52. 600 ifa$=chr$(13)thenreturn
  53. 610 ifa$<"1"ora$>"6"then590
  54. 620 sn=val(a$)-1:printmid$(c$,sn+1,1)hc$"";
  55. 630 mx=int(ch(j)/sv(sn))
  56. 640 fori=0to39:printchr$(20);:next:print" "sk$(sn)": [209]uantity (max"mx"[157])";
  57. 650 n$="":nq=0:inputn$:nq=val(n$):if(nq>mx)then640
  58. 660 ch(j)=ch(j)-nq*sv(sn):bg(sn,j)=bg(sn,j)+nq:tv(sn,j)=bg(sn,j)*sv(sn)
  59. 670 goto540
  60. 680 sys49504:print""spc(8)"[156] [211]ell [207]ptions- [158][208]layer"j
  61. 690 print:fori=0to5:printmid$(c$,i+1,1)i+1"[157]. "sk$(i)" ";
  62. 700 o=usr(bg(i,j)),5,0,0:print" ";:o=usr(tv(i,j)),15,2,3:print:next
  63. 710 print" [195]ash on [200]and:   ";:o=usr(ch(j)),15,2,3:print
  64. 720 printhc$"";:fori=0to39:printchr$(20);:next:print" [211]ell which stock (1-6)"
  65. 730 poke198,0:wait198,1:geta$:poke198,0
  66. 740 ifa$=chr$(13)thenreturn
  67. 750 ifa$<"1"ora$>"6"then730
  68. 760 sn=val(a$)-1:printmid$(c$,sn+1,1);:ifbg(sn,j)>0then800
  69. 770 printhc$"";:fori=0to39:printchr$(20);:next
  70. 780 print" [217]ou don't own any "sk$(sn)"!"
  71. 790 fori=0to4000:next:goto680
  72. 800 printhc$"";:fori=0to39:printchr$(20);:next:print" "sk$(sn)": [209]uantity";
  73. 810 n$="":nq=0:inputn$:nq=val(n$):ifnq>bg(sn,j)then800
  74. 820 ch(j)=ch(j)+nq*sv(sn):bg(sn,j)=bg(sn,j)-nq:tv(sn,j)=bg(sn,j)*sv(sn)
  75. 830 goto680
  76. 840 yr=yr+1:x=int(rnd(.)*6):y=rnd(x)*7+1:k=rnd(y)*2:ifk>1theny=0-y
  77. 850 print""spc(30)m$(int(yr/20))
  78. 860 sv(x)=sv(x)+y:ifsv(x)<0thensv(x)=0:gosub1010:goto940
  79. 870 sv(x)=int(sv(x)*100)/100:ifsv(x)>80thensv(x)=80
  80. 880 k=rnd(x)*10:if(k>8)and(sv(x)<10)thensv(x)=sv(x)+k*2:gosub990
  81. 890 ifk<3andsv(x)>70thensv(x)=sv(x)/5:gosub1000
  82. 900 forp=1to2:tv(x,p)=int((bg(x,p)*sv(x))*100)/100:next
  83. 910 forp=1to2:tw(p)=0:fori=0to5:tw(p)=tw(p)+tv(i,p):next:ft(p)=tw(p)+ch(p)
  84. 920 z=x:gosub120:next:gosub190
  85. 930 ifsv(x)<70then980
  86. 940 forp=1to2:ifbg(x,p)>0thendv=bg(x,p)*k:gosub1260:ch(p)=ch(p)+dv
  87. 950 if(bg(x,p)>0)and(sv(x)=80)then gosub1310:ch(p)=ch(p)+bg(x,p)*25
  88. 960 ifbg(x,p)>0thenpoke198,0:wait198,1:poke198,0:sys49504
  89. 970 next:ifbg(x,1)>0orbg(x,2)>0thengosub1620
  90. 980 return
  91. 990 poke53280,5:fortt=0to100:next:poke53280,6:return
  92. 1000 poke53281,1:fortt=0to100:next:poke53281,0:return
  93. 1010 z=x:forp=1to2:gosub120:next:gosub190
  94. 1020 reada$:ifa$="end"thenrestore:goto1020
  95. 1030 sv(x)=30:bg(x,1)=0:bg(x,2)=0:tv(x,1)=0:tv(x,2)=0
  96. 1040 forp=1to2:fori=0to5:tw(p)=tw(p)+tv(i,p):next:ft(p)=tw(p)+ch(p):next
  97. 1050 sys49504:print"  "sk$(x)" [158]has gone broke! [201]f you"
  98. 1060 sk$(x)=a$:print"  owned any of this stock, you will"
  99. 1070 print"  notice you no longer have any."
  100. 1080 print""tab(12)"[156][208][210][197][211][211][160][193][206][217] [203][197][217]"
  101. 1090 poke198,0:wait198,1:poke198,0:gosub1620
  102. 1100 a=0:forp=1to2:if(ft(p)>gl)thena=a+p
  103. 1110 if(ft(p))<100thena=a+p
  104. 1120 next:ifa<1thenreturn
  105. 1130 w=1:ifft(2)>ft(1)thenw=2
  106. 1140 poke53280,15:poke53281,15
  107. 1150 print"[147][144][198]inal [211]tandings:"
  108. 1160 print"  [208]layer 1 [193]ssets:   ";:pu=usr(ft(1)),15,2,3:print
  109. 1170 print"  [208]layer 2 [193]ssets:   ";:pu=usr(ft(2)),15,2,3:print
  110. 1180 print"[208]layer";w;"has won the game!"
  111. 1190 ifft(w)<1000000then1220
  112. 1200 print"[217]ou are a millionaire! [195]ongratulations!"
  113. 1210 goto1250
  114. 1220 p=1:ifw=1thenp=2
  115. 1230 print"[193]lthough you won only because [208]layer";p
  116. 1240 print"had less than $100.00 in assets."
  117. 1250 poke198,0:wait198,1:poke198,0:run
  118. 1260 sys49504:print" [208]layer"p
  119. 1270 print" [155][217]ou own";bg(x,p)"pieces of "sk$(x)
  120. 1280 print" [212]hey are worth ";:tv(x,p)=bg(x,p)*sv(x):o=usr(tv(x,p)),10,2,3:print
  121. 1290 print" [217]ou recieve    ";:o=usr(dv),10,2,3:print
  122. 1300 print" in dividends.":return
  123. 1310 print"[154] [198]or your loyalty, you recieve a"
  124. 1320 print" special bonus of ";:bb=bg(x,p)*25:o=usr(bb),10,2,3:print:return
  125. 1330 forp=1to2:yp=ft(p)-ow(p):tx=yp/4:ifyp<0thentx=0:ly(p)=ly(p)+1:ws=3-ly(p)
  126. 1340 print"[147] [144][213]ncle  [211]  [193]  [205] [146] [144]wants his share!"
  127. 1350 print" [208]layer";p
  128. 1360 print"  [217]our current assets:"tab(24);:pu=usr(ft(p)),15,2,3:print
  129. 1370 print"  [217]ou started with:"tab(24);:pu=usr(ow(p)),15,2,3:print
  130. 1380 ifyp<0then1440
  131. 1390 print"  [217]ou have earned:"tab(24);:pu=usr(yp),15,2,3:print
  132. 1400 print"  [213]ncle [211]am's 25% tax:"tab(24);:pu=usr(tx),15,2,3:print
  133. 1410 print" [212]hank you, [208]layer";p"[157]."
  134. 1420 print" [200]ave a nice day!"
  135. 1430 ch(p)=ch(p)-tx:ly(p)=0:ft(p)=tw(p)+ch(p):goto1530
  136. 1440 ifly(p)=3then1550
  137. 1450 print"[215][193][210][206][201][206][199]: [144][212]hrough complete incompetence,"
  138. 1460 print"you have managed to completely"
  139. 1470 print"underwhelm the [206]ew [217]ork [211]tock [197]xchange,"
  140. 1480 print"embarrassing your friends, neighbors,"
  141. 1490 print"and relatives. [201]f this unseemly"
  142. 1500 print"behavior continues for"ws"more years,"
  143. 1510 print"your seat on the stock exchange will"
  144. 1520 print"given to one who is more worthy!"
  145. 1530 print""spc(12)"[144][208][210][197][211][211] [193][206][217] [203][197][217]":poke198,0:wait198,1:poke198,0
  146. 1540 ow(p)=ft(p):next:return
  147. 1550 print"[144] [208]layer";p"[157], the game is over for you!"
  148. 1560 print" [217]ou've lost money for the past 3 years"
  149. 1570 print" and you lost your seat on the"
  150. 1580 print" stock exchange. [212]oo bad!"
  151. 1590 fort=0to6000:next
  152. 1600 poke198,0:wait198,1:poke198,0:run
  153. 1610 end
  154. 1620 print"[147]          [155]  [211]tock [205]arket 64             "
  155. 1630 print""tab(13)"[195]urrent [214]alue"
  156. 1640 printtab(7)"0 10 20 30 40 50 60 70 80"
  157. 1650 fori=0to5
  158. 1660 z=i:gosub200
  159. 1670 next
  160. 1680 print""
  161. 1690 print"[162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][157][157][157][157][148][162]"
  162. 1700 print"[155][211]tocks [155][208]layer 1 [193]ssets  [155][208]layer 2 [193]sets [157][157][157][157][148]s"
  163. 1710 print"[162][162][162][162][162][162] [162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162] [162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][157][157][157][157][148][162][146]"
  164. 1720 fori=0to5:q$=mid$(c$,i+1,1):printq$;sk$(i)tab(6)" [146]"q$;
  165. 1730 printspc(16)" [146]"
  166. 1740 next
  167. 1750 print"[162][162][162][162][162][162] [146][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162] [146][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][146][157][157][157][157][148][162]
  168. 1760 [153]"list(NULL)(NULL)(NULL)len(NULL)(NULL) list                 list               cmdcmdcmdcmdsave "
  169. 1770 [153]"print  lenatn(NULL)left$ print                 print               cmdcmdcmdcmdsave "
  170. 1780 [153]"sys (NULL)(NULL)(NULL)atn(NULL) sys                 sys               cmdcmdcmdcmdsave "
  171. 1790 [153]"newnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewcmdcmdcmdcmdsavenewwait"
  172. 1800 [129]p[178]1[164]2:[129]z[178]0[164]5:[141]120:[130]:[130]
  173. 1810 [153]"";
  174. 1820 [153]"     list (NULL)ress (NULL)(NULL)atnlenval or ascright$(NULL)val for (NULL)enu     cmdcmdcmdsave "
  175. 1830 [151]53265,27:[151]53296,0:[142]
  176. 1840 [142]
  177. 1850 [128]
  178. 1860 [134]i,j,p1,b,p,jy
  179. 1870 [134]a$,b$,c$
  180. 1880 [134]ch(2),ow(2),sk$(5),sv(5),bg(5,2),tv(5,2),tw(2),ft(2),ly(2),m$(11)
  181. 1890 [151]785,0:[151]786,192:[151]650,127
  182. 1900 yr[178]0:j1[178]56320:j2[178]j1[170]1
  183. 1910 b$[178]"tantantantantantantantantantantantantantantantantantantantantantantantan"
  184. 1920 c$[178]"listsysforopenclrprint"
  185. 1930 ch(1)[178]10000:ch(2)[178]10000:ow(1)[178]ch(1):ow(2)[178]ch(2):gl[178]1000000
  186. 1940 hc$[178]""
  187. 1950 [151]53281,0:[151]53280,6:[153]"load"
  188. 1960 [153][163]9)"print                    waitpokenew"
  189. 1970 [153][163]9)"print  (NULL)tock (NULL)arket 64   poke "
  190. 1980 [153][163]9)"print                    poke "
  191. 1990 [153][163]9)"pokelognewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewpokenew"
  192. 2000 [153][163]9)"list (NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)pokewaitpos"
  193. 2010 [153][163]9)"list (NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)poke "
  194. 2020 [153][163]9)"list (NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)openfnthenlist(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)poke "
  195. 2030 [153][163]9)"list (NULL)forfnthenlist(NULL)(NULL)(NULL)(NULL)openfnthenlist(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)(NULL)contfnthenlist(NULL)poke "
  196. 2040 [153][163]9)"list (NULL)forfnthenlist(NULL)sysfnthenlist(NULL)openfnthenlist(NULL)(NULL)(NULL)(NULL)fnthenlist(NULL)contfnthenlist(NULL)poke "
  197. 2050 [153][163]9)"list (NULL)forfnthenlist(NULL)sysfnthenlist(NULL)openfnthenlist(NULL)(NULL)(NULL)(NULL)fnthenlist(NULL)contfnthenlist(NULL)poke "
  198. 2060 [153][163]9)"list (NULL)forfnthenlist(NULL)sysfnthenlist(NULL)openfnthenlist(NULL)clrfnthenlist(NULL)fnthenlist(NULL)contfnthenlist(NULL)poke "
  199. 2070 [153][163]9)"list (NULL)forfnthenlist(NULL)sysfnthenlist(NULL)openfnthenlist(NULL)clrfnthenlist(NULL)fnthenlist(NULL)contfnthenlist(NULL)poke "
  200. 2080 [153][163]9)"pokelognewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewpokenew"
  201. 2090 [153][163]52)"lenopyright 1992"
  202. 2100 [153][163]5)"printlen(NULL)(NULL)(NULL)(NULL)(NULL)val (NULL)ublications right$ntl (NULL)(NULL)str$"
  203. 2110 [140]
  204. 2120 [135]a$:[139]a$[179][177]"end"[167]2120
  205. 2130 [129]i[178]0[164]11:[135]m$(i):[130]
  206. 2140 [129]i[178]49152[164]49535:[135]j:[151]i,j:[130]
  207. 2150 [140]
  208. 2160 [129]i[178]0[164]5:[135]sk$(i):sv(i)[178]30:[130]
  209. 2170 [153]""[163]8)"sys (NULL)(NULL)val(NULL)(NULL) atn(NULL)(NULL) (NULL)val(NULL) (NULL)(NULL) (NULL)(NULL)atn(NULL) "
  210. 2180 [161]a$:[139]a$[178]""[167]2180
  211. 2190 [142]
  212. 2200 [131]"(NULL)ilver","lenars  ","(NULL)izza ","(NULL)oap  ","ascurs  ","(NULL)teel ","(NULL)il   "
  213. 2210 [131]"chr$old  ","lenorn  ","(NULL)ocks ","(NULL)rucks","lenopper","(NULL)heep ","left$otels"
  214. 2220 [131]"(NULL)ires ","peekuses ","peekrass ","(NULL)hirts","(NULL)hones","peekoats ","(NULL)aper "
  215. 2230 [131]"(NULL)rains","peekeads ","lenoffee","mid$ewels"
  216. 2240 [131]"end"
  217. 2250 [131]"mid$anuary  ","ascebruary ","(NULL)arch    ","atnpril    ","(NULL)ay      "
  218. 2260 [131]"mid$une     ","mid$uly     ","atnugust   "
  219. 2270 [131]"(NULL)eptember","(NULL)ctober  ","(NULL)ovember ","str$ecember "
  220. 2280 [131]169,0,160,79,153,176,193,136,16,250,32,221,189,133,251,132
  221. 2290 [131]252,160,0,177,251,153,192,193,240,3,200,208,246,160,0,152
  222. 2300 [131]72,32,241,183,104,168,138,153,176,193,200,192,3,208,240,173
  223. 2310 [131]178,193,240,17,41,1,240,3,32,176,192,173,178,193,41,2
  224. 2320 [131]240,3,32,16,193,234,234,234,234,234,32,208,192,169,192,160
  225. 2330 [131]193,133,251,132,252,173,192,193,201,32,208,2,230,251,160,0
  226. 2340 [131]177,251,240,10,200,201,64,208,247,162,23,76,55,164,204,176
  227. 2350 [131]193,240,45,144,27,162,42,160,0,177,251,240,33,138,145,251
  228. 2360 [131]200,208,246,172,176,193,169,0,153,192,193,24,144,18,234,234
  229. 2370 [131]169,32,32,210,255,200,204,176,193,208,245,234,234,174,230,251
  230. 2380 [131]160,0,177,251,240,6,32,210,255,200,208,246,96,0,0,0
  231. 2390 [131]173,192,193,201,32,240,16,160,31,136,185,192,193,200,153,192
  232. 2400 [131]193,136,208,245,160,1,174,160,0,169,36,153,192,193,96,0
  233. 2410 [131]160,0,185,192,193,240,9,201,46,240,5,200,192,64,208,242
  234. 2420 [131]173,177,193,208,4,153,192,193,96,169,46,153,192,193,200,24
  235. 2430 [131]152,105,192,168,24,132,251,169,193,133,252,160,0,177,251,208
  236. 2440 [131]4,169,48,145,251,200,204,177,193,208,242,169,0,145,251,96
  237. 2450 [131]160,0,185,192,193,240,2,201,46,240,3,200,208,244,192,5
  238. 2460 [131]144,18,24,152,233,2,141,179,193,192,8,144,7,24,152,233
  239. 2470 [131]5,141,180,193,162,0,189,179,193,240,24,24,105,192,133,251
  240. 2480 [131]169,193,133,252,160,31,136,177,251,200,145,251,136,208,247,169
  241. 2490 [131]44,145,251,232,224,2,208,222,96,187,187,187,187,187,187,187
  242. 2500 [131]169,32,160,0,153,184,5,153,184,6,200,208,247,160,47,153
  243. 2510 [131]184,7,136,16,250,162,11,160,0,24,32,240,255,96,187,187
  244.