home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 53 / 053.d81 / golf (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1988-01-01  |  11.0 KB  |  312 lines

  1. 5 gosub 5000
  2. 10 goto 1370
  3. 20 rem  golf
  4. 30 rem ** accuracy subr **
  5. 40 z=rnd(0):z2=int(54*z)+1:ac=int(3*log(z2))-1
  6. 50 if ac<0 then ac=0
  7. 60 return
  8. 70 rem  **   distance subr **
  9. 80 z=rnd(0):x=20:a=0:odl=dl
  10. 90 if cl=12 or cl=13 then 130
  11. 100 if cl=1 then x=80
  12. 110 if (cl=2 or cl=3) then x=30
  13. 120 goto 210
  14. 130 print:print"1/3, 2/3, or full (1, 2, or 3)";:x=17
  15. 140 get a$:if a$="" then 140
  16. 150 if a$="1" then 190
  17. 160 if a$="2" then a=17:goto 190
  18. 170 if a$="3" then a=34:goto 190
  19. 180 goto 140
  20. 190 print a$;:gosub 4000
  21. 200 rem  sand/rough more diff longer club
  22. 210 if (pl=1 or pl=4 or pl=5 or pl=6) and cl<6 then df=.8*df
  23. 220 if (pl=1 or pl=4 or pl=5 or pl=6) and cl<3 then df=.7*df
  24. 230 di=int(df*(mr(cl)+(x*z)+a+1))
  25. 240 rem  alter dist hit outside of range
  26. 250 z=rnd(0):x=int(5*z)+1:if x<>4 then 290
  27. 260 z=rnd(0):x=int(3*z)+1:if x=2 then 280
  28. 270 di=int(.9*di):goto 290
  29. 280 di=int(1.1*di):goto 290
  30. 290 return
  31. 300 rem ** trouble type subr **
  32. 310 z=rnd(0):pl=int(6*z)+1
  33. 320 return
  34. 330 rem ** trouble subr **
  35. 340 df=1
  36. 350 on pl goto 370,430,470,620,370,620
  37. 360 rem  rough
  38. 370 z=rnd(0):if ((int(2*z)+1)=1) then 400
  39. 380 print:print"your ball is in the right rough"
  40. 390 printdl;"yards from the pin":df=.9:tr=1:goto 680
  41. 400 print:print"your ball is in the left rough"
  42. 410 printdl;"yards from the pin":df=.9:tr=1:goto 680
  43. 420 rem  water
  44. 430 z=rnd(0):wa=int(3*z)+1:print:print wa$(wa)
  45. 440 dl=dl+10:print"after dropping back it's":print dl;"yards from the pin"
  46. 450 sr(i)=sr(i)+1:goto 680
  47. 460 rem  woods
  48. 470 z=rnd(0):wo=int(10*z)+1:if wo<>7 then 510
  49. 480 print:print"aren't you the lucky one. your ball hit"
  50. 490 print"a couple of trees and then bounced into"
  51. 500 print"the fairway ";dl;"yards from the green":goto 680
  52. 510 z=rnd(0):wo=int(3*z):if wo<>1 then 560
  53. 520 dl=odl:lo=1:sr(i)=sr(i)+1
  54. 530 print:print"that one's long gone. you might as well"
  55. 540 print"not even look for it. your ball is "
  56. 550 print dl;"yards from the pin again":goto 680
  57. 560 tr=1:print:print"your ball is ";dl;"yards from the pin"
  58. 570 print"behind some trees, and in a bad lie. "
  59. 580 print"try to chip it back into":print"into play with a pitching wedge"
  60. 590 pw$="y"
  61. 600 goto 680
  62. 610 rem  sand
  63. 620 tr=1:if dl<=50 then 660
  64. 630 print:print "you are in a bunker";dl;"yds from the pin"
  65. 640 z=rnd(0):t=int(z*10):if t=4 then df=1:goto 680
  66. 650 z=rnd(0):df=int(z*6)/10+.3:goto 680
  67. 660 print:print"you are in a green side bunker":printdl;"yds from the pin"
  68. 670 z=rnd(0):df=int(z*5)/10+.5
  69. 680 return
  70. 690 rem ** choose club subr **
  71. 700 print"which club ?    [157][157][157][157]";
  72. 710 get a$:if a$="" then 710
  73. 711 ifa$=chr$(13) then 4100
  74. 720 if(a$>="1"anda$<="9")ora$="p"ora$="s"ora$="c"then print a$;:goto 740
  75. 730 goto 710
  76. 740 get b$:if b$="" then 740
  77. 750 print b$;:if asc(b$)=20 or asc(b$)=157 then goto 710
  78. 751 if b$=chr$(13) then print:print"[145][145]";:goto 700
  79. 760 if b$="w" and (a$>="1" and a$<="3") then cl=asc(a$)-48:goto 820
  80. 770 if b$="i" and (a$>="2" and a$<="9") then cl=asc(a$)-48+2:goto 820
  81. 780 if a$+b$="pw" then cl=12:goto 820
  82. 790 if a$+b$="sw" then cl=13:goto 820
  83. 800 if a$+b$="cl" then gosub 1900:goto 700
  84. 810 print:print"[145]";bl$;"[145]";:goto 700
  85. 820 gosub4000:sr(i)=sr(i)+1
  86. 830 if cl<>1 or (sr(i)<2 or lo=1) then 880
  87. 840 rem   prevent driver off fairway
  88. 850 z=rnd(0):dl=dl-(int(17*z)+1)
  89. 860 print:print"a duff. your ball is now";dl;"yards":print"from the hole."
  90. 870 print"even the pros don't try that one.":goto 700
  91. 880 if pw$<>"y" or cl=12 then 930
  92. 890 rem   should have followed caddie
  93. 900 dl=dl+13:print:print"nice job - it bounced off of a tree."
  94. 910 print"now your're in the fairway":print dl;"yards from the pin"
  95. 920 sr(i)=sr(i)+1:pw$="n":goto 700
  96. 930 pw$="n":return
  97. 940 rem ** putting subr **
  98. 950 dl=dl*3:if tr=1 then ac=ac*1.25
  99. 960 rem if cl>11 and dl>0 and tr=0 then 803
  100. 970 dl=int((dl^2+ac^2)^0.5)
  101. 980 ifac<3andabs(dl)<10thenprint:print:print"nice shot - it hit the pin !"
  102. 990 if dl>1 then 1030
  103. 1000 z=rnd(0):x=int(z*7)+1
  104. 1010 if x=3 then print:print"too bad - your ball is on the lip":goto 1040
  105. 1020 print:print"your ball is 1 foot from the hole":goto 1040
  106. 1030 print:print"your ball is";dl;"feet from the hole"
  107. 1040 print"putting stroke (1-7)";
  108. 1050 get a$:if a$="" then 1050
  109. 1060 printa$;:p=asc(a$)-48:if p<1 or p>7 then print:goto 1040
  110. 1070 sr(i)=sr(i)+1 :gosub 4000
  111. 1080 z=rnd(0):di=int(10*z)+(p-1)*10+1
  112. 1090 if dl<2 and p=1 then 1220
  113. 1100 if dl<10 and abs(dl-di)>4 and p<2 then 1080
  114. 1110 if dl>6 or abs(dl-di)<4 then 1130
  115. 1120 z=rnd(0):x=int(4*z)+1:if x<>3 then di=dl
  116. 1130 if dl<26 or abs(dl-di)>3 then 1150
  117. 1140 z=rnd(0):z2=int(7*z)+1:ifz2<>2thenz=rnd(0):dl=int(15*z)+1:goto 1160
  118. 1150 dl=dl-di:if abs(dl)<4 then 1220
  119. 1160 if di<15 then print:print"dribble...":goto 1180
  120. 1170 print:print"dribble..trickle.."
  121. 1180 if dl>0 then dl=dl-2:goto 990
  122. 1190 dl=dl+2
  123. 1200 ifdl=-1thenprint:print"too much-you slid by 1 foot";:dl=-dl:goto 1020
  124. 1210 print:print"too much-you slid by";:dl=-dl: printdl;"feet";:goto 1030
  125. 1220 if di<6 then print:print"...plunk":goto 1260
  126. 1230 if di<15 then print:print"trickle...plunk":goto 1260
  127. 1240 if di<25 then print:print"dribble..trickle..plunk":goto 1260
  128. 1250 print:print"squiggle..dribble..trickle..plunk"
  129. 1260 print"in the hole"
  130. 1270 return
  131. 1280 data 4,8,11,15,20,24,27,32,36,40,43,47,52,56,60,63,68,72
  132. 1290 data 301,347,152,407,485,390,212,515,337
  133. 1300 data 385,179,420,614,414,432,225,530,440
  134. 1310 data 4,4,3,4,5,4,3,5,4,4,3,4,5,4,4,3,5,4
  135. 1320 data 20,22,18,20,27,20,21,25,21,23,15,23,28,22,23,20,18,19
  136. 1330 data 20,20,20,25,30,25,10,30,20,23,20,25,30,30,30,20,30,28
  137. 1340 data 210,200,180,170,160,150,140,130,120,110,100,50,0
  138. 1350 data 210-290,200-230,180-210,170-190,160-180,150-170,140-160,130-150
  139. 1360 data 120-140,110-130,100-120,50-100,0-50
  140. 1370 print"[147]"
  141. 1380 dim cn$(14),na$(4),yd(18),pa(18),gs(18),tp(18),mr(13),mr$(13),ts(4)
  142. 1390 dim pd(4),sr(4),fw(18),pm$(7)
  143. 1400 wa$(1)="your ball landed in a creek"
  144. 1410 wa$(2)="do you have scuba diving equipment with you? its in a pond"
  145. 1420 wa$(3)="splash! you'll have a hard time finding it - its in a lake"
  146. 1430 x=rnd(ti):fori=1to40:bl$=bl$+" ":next
  147. 1440 pm$(1)="double eagle!!":pm$(2)="eagle!":pm$(3)="birdie":pm$(4)="par"
  148. 1450 pm$(5)="bogey":pm$(6)="double bogey":pm$(7)="triple bogey"
  149. 1460 fori=1to18:read tp(i):next:for i=1to18:read yd(i):next
  150. 1470 fori=1to18:read pa(i):next
  151. 1480 for i=1to18:read gs(i):next:for i=1to18:read fw(i):next
  152. 1490 for i=1to13:read mr(i):next:for i=1to13:read mr$(i):next
  153. 1500 poke 53280,5:poke 53281,5
  154. 1510 print"[147]welcome to the tanglewood country club."
  155. 1520 print"   do you want instructions (y/n)?";
  156. 1530 get a$:if a$="" then 1530
  157. 1540 print a$;:if a$="n" then 1760
  158. 1550 print"[147]welcome to the [153]tanglewood country club,"
  159. 1560 print" a simulated golf course.  available "
  160. 1570 print" for you is a full set of clubs "
  161. 1580 print"consisting of the following, along with"
  162. 1590 print" expected ranges & selection codes.":print
  163. 1600 print"[158]club";tab(8)"[158]range";tab(15);"[158]code";tab(21)"[158]club";
  164. 1610 print tab(28);"[158]range";tab(35);"[158]code":print"[146]"
  165. 1620 fori=1to3:print"[151]"str$(i)"wood"tab(7)""mr$(i)tab(15);""str$(i);"w":next
  166. 1630 fori=4to6:print"[151]"str$(i-2)"iron";tab(7)""mr$(i)tab(15)""str$(i-2);"i"
  167. 1640 next:print"";:print
  168. 1650 fori=7to11
  169. 1660 printtab(20)"[151]"str$(i-2);"iron";
  170. 1665 printtab(27)""mr$(i);tab(35)""str$(i-2);"i":next
  171. 1670 print tab(20);"[151] pw ";tab(28)""mr$(12);tab(35);" pw"
  172. 1680 print tab(20);"[151] sw ";tab(29)""mr$(13);tab(35);" sw"
  173. 1690 print:print"the course is 6785 yds. long with a par"
  174. 1700 print"of 72, and has plenty of rough, water,"
  175. 1710 print"trees & bunkers. i will caddie for you"
  176. 1720 print"(at a modest rate) & i know the course"
  177. 1730 print"pretty well. as in a real game of golf,"
  178. 1740 print"unexpected triumphs and disasters lay "
  179. 1750 print"ahead of you. good luck and have fun!"
  180. 1751 print"      press any key to continue. 
  181. 1752 [161]a$:[139]a$[178]"" [167] 1752
  182. 1760 [153]"load       number of players poke(1-4poke)";
  183. 1770 [161] a$:[139] a$[178]"" [167] 1770
  184. 1780 [153] a$:[139] a$[179]"1" [176] a$[177]"4" [167] 1760
  185. 1790 np[178][198](a$)[171]48:[129]i[178]1[164]np
  186. 1800 na$(i)[178]"":[153]"loadsys player #";i
  187. 1805 [153]"what is your namepoke: ";
  188. 1807 [153]"tocmd";:na$(i)[178]""
  189. 1810 [161] a$:[139] a$[178]"" [167] 1810
  190. 1820 [139] a$[178][199](13)[175][195](na$(i))[177]0 [167] [153]" ":[137] 1860
  191. 1821 [139] a$[178][199](13)[167] 1810
  192. 1830 [139] a$[178][199](20)[175][195](na$(i))[178]0 [167] 1810
  193. 1831 [139] a$[178][199](20)[167]na$(i)[178][200](na$(i),[195](na$(i))[171]1):[153]a$;:[137]1810
  194. 1832 [139] [195](na$(i))[177]12 [167] 1810
  195. 1833 [139] a$[179]" "[176]a$[177]"z" [167] 1810
  196. 1840 na$(i)[178]na$(i)[170]a$:[153]a$"tocmd";:[137] 1810
  197. 1860 :
  198. 1880 [130]:[153]"load"
  199. 1890 [137] 2010
  200. 1900 [153]:[153]
  201. 1910 [143]
  202. 1920 [153]"loadpoke           your clubs sir,":[153]"syswoodswait"
  203. 1930 [129] t[178]1[164]3:[153]""[196](t);"w ";mr$(t):[130]
  204. 1940 [153] "onononon";[163]11) "sysironswait":[153]"on";
  205. 1950 [129] t[178]4[164]8:[153] [163]16);""[196](t[171]2);"i ";mr$(t):[130]
  206. 1960 [153]"ononononon";
  207. 1970 [129] t[178]9[164]11:[153] [163]27);""[196](t[171]2);"i ";mr$(t):[130]
  208. 1980 [153] [163]28);"pw ";mr$(12):[153] [163]28);"sw ";mr$(13)
  209. 1990 [153]"":[142]
  210. 2000 [143] ** main loop for each hole **
  211. 2010 [153]"load":[129]h[178]1[164]18:[129] i[178]1[164]np
  212. 2020 dl[178]yd(h):sr(i)[178]0
  213. 2030 [153]"load";:[141] 1920:[153]"hole # ";h;" par";pa(h);yd(h);"yards";
  214. 2040 [139] pa(h)[179]4 [167] [153]:[137] 2080
  215. 2050 [139] fw(h)[179]22 [167] [153]"  narrow-fw":[137] 2080
  216. 2060 [139] fw(h)[179]29 [167] [153]"  medium-fw":[137] 2080
  217. 2070 [153]"    wide-fw"
  218. 2080 [153]"player #";i;na$(i)
  219. 2090 df[178]1:pl[178]0:tr[178]0
  220. 2100 [141] 700
  221. 2110 [141] 80:[141] 40
  222. 2120 [139] cl[178]1 [167] ac[178]ac[172]3
  223. 2130 [139] cl[178]2 [167] ac[178][181](ac[172]2.5)
  224. 2140 [139] cl[178]3 [167] ac[178][181](ac[172]2)
  225. 2150 [139] cl[177]3 [175] cl[179]8 [167] ac[178][181](ac[172]1.5)
  226. 2160 lo[178]0:dl[178]dl[171]di
  227. 2170 [139] dl[179][177]0 [167] 2230
  228. 2180 [139] ac[177]3 [167] 2220
  229. 2190 [139] sr(i)[179][177]1 [167] 2210
  230. 2200 [153]"load":[153]:[153]:[153]"h o l e   i n   o n e  !!!!":[137] 2400
  231. 2210 [153]:[153]:[153]"nice  s h o t!!":[153]"its in the hole !":[137] 2400
  232. 2220 [153]:[153]:[153]"nice shot - pin high":[141] 950:[137] 2400
  233. 2230 [139] [182](dl)[177]gs(h) [176] cl[177]3 [167] 2270
  234. 2240 [143]  make 2- & 3- wood less accurate when hitting green
  235. 2250 t[178]dl:dl[178]odl:[141] 80:[141] 40:dl[178]dl[171]di
  236. 2260 [139] [182](t)[177][182](dl) [167] dl[178]t
  237. 2270 [139] cl[179]12 [167] 2310
  238. 2280 [143] make wedges more accurate
  239. 2290 t[178]dl:dl[178]odl:z[178][187](0):[141] 210:[141] 40:dl[178]dl[171]di
  240. 2300 [139] [182](t)[179][182](dl) [167] dl[178]t
  241. 2310 [139] dl[177]0 [167] 2340
  242. 2320 dl[178][171]dl:[139] dl[179]gs(h) [167] [141] 950:[137] 2400
  243. 2330 [153]:[153]"too much.":[153]"you overshot the hole by";dl;"yards";
  244. 2340 [139] dl[179]gs(h) [167] [141] 950:[137] 2400
  245. 2350 z[178][187](0):de[178][181](5[172]z)[170]1
  246. 2360 [139] ac[177]fw(h) [176] de[178]4 [167] [141]310:[141] 340:[137] 2100
  247. 2370 [139] dl[179][178]gs(h) [167] [141]950:[137] 2400
  248. 2380 [153]:[153]"your ball is in the fairway":[153]dl;"yards from the pin"
  249. 2390 [137] 2080
  250. 2400 [153]:[153]"hole";h;"player#";i;"score";sr(i);:ts(i)[178]ts(i)[170]sr(i)
  251. 2410 t[178]sr(i)[171]pa(h)[170]4:[139] t[177]7 [167] [153]"real bad":[137] 2430
  252. 2420 [153] pm$(t)
  253. 2430 [153]:[153]"press any key to continuewait"
  254. 2440 [161] a$:[139] a$[178]"" [167] 2440
  255. 2450 [130]
  256. 2460 [153]"load"
  257. 2470 [153]:[153]"hole #";h:[153]
  258. 2480 [129]j[178]1[164]np:[153] na$(j);:[129] k[178][195](na$(j))[164]15:[153] " ";:[130]
  259. 2490 t[178]sr(j)[171]pa(h)[170]4:[139] t[177]7 [167] [153]"real bad":[137] 2510
  260. 2500 [153] pm$(t)
  261. 2510 [130]:[153]
  262. 2520 [139] h[178]1 [167] [153]:[153]"after 1 hole":[153]:[137] 2540
  263. 2530 [153]:[153]"after ";h;"holes":[153]
  264. 2540 [129] j[178]1[164]np:[153] na$(j);
  265. 2550 [129] k[178][195](na$(j)) [164] 15:[153] " ";:[130]:[153]"is ";
  266. 2560 x[178]ts(j)[171]tp(h)
  267. 2570 [139] x[178]0 [167] [153]"even":[137] 2600
  268. 2580 [139] x[177]0 [167] [153]"+";x:[137] 2600
  269. 2590 [153] x
  270. 2600 [130]
  271. 2610 [153]:[153]"press any key to continuewait"
  272. 2620 [161] a$:[139] a$[178]"" [167] 2620
  273. 2630 [130]
  274. 2640 [153]:[129] j[178]1[164]np:[153]na$(j);" had a ";ts(j):[130]
  275. 2650 [153]:[153]:[153]"would you like to play again (y/n)?"
  276. 2660 [161] a$:[139] a$[178]"" [167] 2660
  277. 2670 [139] a$[178]"y" [167] [138]
  278. 2680 [137]4200
  279. 3000 [153]a$;:na$(i)[178][202](na$(i),1,[195](na$(i))[171]1):[142]
  280. 4000 qa$[178]"                                        ":qd$[178]""
  281. 4001 [153]qd$:[129]x[178]1[164]14:[153]qa$;:[130]:[153]qd$:[142]
  282. 4100 [153]:   [153]"onsys do you want to quit to loadstar? (y/n)"
  283. 4102 [161]a$:[139]a$[178]""[167] 4102
  284. 4105 [139]a$[178]"y"[167] 4200
  285. 4106 [139]a$[178]"n"[167] 4150
  286. 4110 [137] 4102
  287. 4150 [153]"on                                       "
  288. 4151 [153]"on";:[137] 700
  289. 4200 [159]15,8,15,"r0:hello connect=hello connect":[132]15,er,er$:[160]15
  290. 4201 [139] er[179][177]63 [167] [153]"load":[128]
  291. 4205 [147]"hello connect",8
  292. 5000 [151]53280, 6:[151]53281, 1:[153]"loadreturn";:[151]53265,[194](53265)[175]239
  293. 5001 [153]"list         waitclrOusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrPlist                   waitclrsgnloadstarpres";
  294. 5002 [153]"entsthenprint# list            cont      waitclrLandandandandandandandandandandandandandandandandandandandsqr cont      listclose    closecont  ";
  295. 5003 [153]"                          cont      listclose     cont                              ";
  296. 5004 [153]"    listclose    closecont   waitOusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrPcont    listclose    closecont  waitclrOsgn";
  297. 5005 [153]"thenclrPcont   listclose     cont  waitclrsgnsgngolfthenclrthen";
  298. 5006 [153]" cont  listclose     cont  waitclrLsgnprint#tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(thenclrsqr cont  listclose     cont   waitLandand";
  299. 5007 [153]"andandandandandandandandandandandandandandandandandandandandandandandsqr  cont  listclose    closecont                               cont";
  300. 5008 [153]"   listclose    closecont                                  list      cont   waitforOusrusrusrusrusrusrusrusrusrusrusrusrusr";
  301. 5009 [153]"usrusrusrusrusrusrusrusrusrusrusrusrPcont    list      cont   waitforsgnverifywrittenbyforthen cont   list   ";
  302. 5010 [153]"close  cont   waitforsgnthen cont   list     closecont   waitforsgnverifymichaeljpo";
  303. 5011 [153]"ltonavageforthen cont   list   close  cont   waitforLandandandandandandandandandandandandandandandandandandandandandandandandandsqr cont   list    ";
  304. 5012 [153]"  cont                               cont   list      cont                         ";
  305. 5013 [153]"         list   close closecont                                  list     closecont             ";
  306. 5014 [153]"                     list   close  cont    waitclrOusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrusrPcont     list    ";
  307. 5015 [153]" closecont    waitclrsgnpressspacetocontinue+ cont    list          waitclrLandandandandandandandandandandandandandandandand";
  308. 5016 [153]"andandandandandandandsqrprint# list               print#                         list      "
  309. 5017 [151]2023,96[170]128:[151]56295,15:[151]53265,[194](53265)[176]16
  310. 5018 [161]a$:[139]a$[179][177]" "[167] 5018
  311. 5099 [142]
  312.