home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 53 / 053.d81 / golf (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  11KB  |  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]"