home *** CD-ROM | disk | FTP | other *** search
/ C64 Live 6 / C64_Live_6_19xx_-_de.d64 / golf (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  8KB  |  195 lines

  1. 5 print"[147][155]***  golf  ***":v=53248:poke v+21,0:poke v+32,11:poke v+33,11:goto 15
  2. 6 rem
  3. 7 if z>w then z=z and w:poke v6,c
  4. 8 return
  5. 9 if d-c>w then poke v6,peek(v6)or 16:c=w+1:return
  6. 10 if d<c then poke v6,peek(v6)and not 16:c=0
  7. 11 return
  8. 15 v6=v+16:v0=v+30:v1=v0+1:o=21.9:w=255:m=40:sx=.8:sy=.8:s=54272:j=56320:b=2040
  9. 16 dim p%(38),p(50):for i=0 to 38:read p%(i):next
  10. 17 for i=0 to 7:read r(i),g(i),b(i),h(i):next:n=20
  11. 18 for i=0to 10:read p(i):p(n+i)=-p(i):p(n-i)=p(i):p(m-i)=-p(i):p(m+i)=p(i):next
  12. 20 for i=832 to 864:read q:poke i,q:next:for i=i to 989:poke i,0:next
  13. 25 for i=i to i+33:read q:poke i,q:next:for i=12800 to i+46:read q:poke i,q:next
  14. 30 for i=i to i+38:poke i,0:next:for i=i to i+297:read q:poke i,q:next
  15. 35 poke 924,24:poke 927,60:poke 930,60:poke933,24:pokev+42,5:pokev+43,1:
  16. 40 def fn b(x)=o+(sin(x/2)+cos(x/4))/2
  17. 42 def fn h(x)=k+sin(x/5)/2+(x-a)*l
  18. 45 poke v+37,10:poke v+38,0:poke b,200:poke b+3,203:poke b+4,14
  19. 50 poke s,0:poke s+6,0:poke s+7,0:poke s+9,0:poke s+10,8
  20. 55 poke s+13,0:poke s+14,0:poke s+19,9:poke s+20,0:poke s+24,15
  21. 60 print"[147]":poke v+33,6:poke v+32,11
  22. 62 print tab(14)"[213][192][201][213][192][201][201]  [213][192][201]"
  23. 65 print tab(14)"[221]  [221][160][221][221][160][160][221]"
  24. 68 print tab(14)"[221][192][201][221] [221][221]  [171][192]"
  25. 70 print tab(14)"[221] [221][221] [221][221]  [221]"
  26. 72 print tab(14)"[202][192][203][202][192][203][202][192][203][203]"
  27. 75 print tab(14)"************[144]"
  28. 80 print tab(8)"1 player........  key 1"
  29. 82 print tab(8)"2 players.......  key 2":i=10
  30. 85 get a$:if a$="1"or a$="2"then 90
  31. 86 a=55600:for k=0 to 38:poke a+p%(k),i^1:next
  32. 87 for k=0 to 11:poke 55750+k,i^1:next:i=7-(i=7)*3:goto 85
  33. 90 ss=val(a$):bs(1)=999:bs(2)=999:sm(1)=0:sm(2)=0:sp=0
  34. 95 s(1)=0:s(2)=0:sp=sp+1:for n=1 to ss:poke s+8,15:poke s+12,5:poke s+15,150
  35. 99 rem
  36. 100 poke v+33,9:print"[147]":poke v+33,6:poke v+32,11:poke v+23,42:poke v+29,232
  37. 105 poke v+28,7:poke v+40,5:poke v+41,5:poke v+44,0:poke v+45,15:poke v+46,15
  38. 110 poke b+1,201:poke b+2,202:poke b+5,204:poke b+6,13:poke b+7,15
  39. 115 q=rnd(ti):a=q*9999:a%=q*20:x=a+a%:h=fn b(x)
  40. 120 y=fn b(x+10):if y+1<h then 115
  41. 125 if y>h then h=y
  42. 130 z=a%+55297+int(h)*m:for i=0 to 8:poke z+i,14:next
  43. 135 z=z+41:for i=0 to 6:poke z+i,14:next:l=a%+1024:r=l+10
  44. 140 k=0:for x=a+37 to a+39:if fn b(x)>=22 then k=1
  45. 145 next:y=56173:for i=0 to 2:for x=0 to k:poke y+i+x*m,8:next:next
  46. 150 poke v6,1:poke v,64:poke v+1,fn b(a+38)*8+35
  47. 155 k=1:if a%>14 then k=3:goto 165
  48. 160 if a%>7 then k=2
  49. 165 x%(k-1)=a%+8:for i=k to 3:x%(i)=rnd(1)*(11+i*6-x%(i-1))+x%(i-1)+6:next
  50. 170 on k goto 185,180
  51. 175 x%(1)=rnd(1)*(a%-12)+4:x%(2)=rnd(1)*(a%-8-x%(1))+x%(1)+6:goto 185
  52. 180 x%(1)=rnd(1)*(a%-6)+4
  53. 185 x%=rnd(1)*3+1
  54. 190 y%=rnd(1)*3+1:if y%=x%then 190
  55. 195 k=6-x%-y%:x=x%(x%):z=x*8+18:c=3:gosub 7:poke v+2,z:poke v+3,fn b(x+a)*8+8
  56. 200 x=x%(y%):z=x*8+18:c=5:gosub 7:poke v+4,z:poke v+5,fn b(x+a)*8+29
  57. 205 x=x%(k):z=x*8+8:c=41:gosub 7:poke v+6,z:poke v+10,z
  58. 210 z=fn b(x+a)*8+8:poke v+7,z:poke v+11,z:poke v+8,0
  59. 215 poke v+12,132:poke v+13,73:poke v+14,180:poke v+15,63
  60. 220 x=a:for i=1024 to 1063:if i>l and i<r then y=h:goto 230
  61. 225 y=fn b(x)
  62. 230 y%=y:poke i+m*y%,b(8*(y-y%)):for y=y%+1 to 24:poke i+m*y,160:next:x=x+1:next
  63. 235 print"[144]":on ss gosub 670,680:l=a%+2:r=l+10
  64. 240 print tab(5)"[172][190]  [188][146][187]":print tab(5)"[190]    [188]"
  65. 245 print tab(5)"  [152]              ":print tab(3)"[164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
  66. 250 print tab(5)"[187]    [172][144]":poke v+21,w:z=931:p=0:u=5
  67. 254 rem
  68. 255 c=0:x=a:x%=0:d=14
  69. 260 poke s+6,0:y=fn b(x):e=y*8+37:x=0
  70. 265 poke v+8,d-c:poke v+9,e:poke v+27,0:gosub 650:if x%>38 then 310
  71. 270 gosub 550:f=2*sgn(t):k=f:g=g*t:g=g*g:t=p(p)/t:poke v+27,16
  72. 275 poke z,0:poke s+4,129:y=peek(v0)+peek(v1)
  73. 280 d=d+k:if d<14 or d>328 then poke s+5,9:poke s+4,0:poke s+4,17:k=-k:d=d+k+k
  74. 285 if peek(v0)and 14 then poke s+18,0:poke s+18,129:k=-k:d=d+k+k
  75. 290 x=x+f:y=e+x*(x/g-t):if y>240 then 300
  76. 295 gosub 9:poke v+8,d-c:poke v+9,y:if not peek(v1)and 16 then 280
  77. 300 x%=d/8+.5:if x%>l and x%<r then poke v+9,h*8+40:goto 500
  78. 305 poke s+11,0:poke s+11,17:x=x%-2+a:d=x%*8-2:gosub 9:goto 260
  79. 309 rem
  80. 310 print"":for i=0 to 28:for k=0 to 4:print"";chr$(20):next:print"[145][145][145][145][145][145]"
  81. 315 poke s+18,16:poke s+18,17:for t=0 to 50:next:next
  82. 319 rem
  83. 320 poke v+21,0:print"[147]":poke v+33,9:poke v,207:poke v+1,120:poke v+28,1
  84. 325 poke b+1,13:poke b+2,15:poke b+5,205:poke b+6,205:poke b+7,205
  85. 330 poke v+40,15:poke v+41,15:poke v+44,7:poke v+45,13:poke v+46,7
  86. 335 for i=v+10 to v+13:poke i,rnd(1)*140+25:i=i+1:poke i,rnd(1)*85+120:next
  87. 340 poke v+14,rnd(1)*62:poke v+15,rnd(1)*85+120:poke v6,128
  88. 345 e=(y-19)*50+35:d=int((rnd(1)+x%-39)*104+15):c=0:gosub 9
  89. 350 poke v+8,d-c:poke v+9,e:poke s+8,5:poke s+12,96
  90. 355 poke v+2,132:poke v+3,73:poke v+4,180:poke v+5,63
  91. 360 x%=(fn b(a+39)-fn b(a+37))*7:q=sgn(x%):l=q/9:k=6-q-q:q=q*sx:poke 55720,0
  92. 365 x=a:for i=1024 to 1063:y=fn h(x):y%=y:for t=0 to y%-1:poke i+t*m,160:next
  93. 370 poke i+m*y%,h(8*(y-y%)):x=x+1:next
  94. 375 poke s+15,15:on ss gosub 670,680:poke v+23,192:poke v+29,102:poke v+21,247
  95. 380 gosub 650:gosub 550:g=g/4+1:f=p(p):poke z,0:poke s+4,129
  96. 384 rem
  97. 385 i=peek(v0)+peek(v1):for i=g to 1 step-.07:x0=d:y0=e:if i<3 then d=d+q:e=e+sy
  98. 390 d=d+t*i:if d<14 or d>330 then poke s+18,0:poke s+18,17:t=-p(p+10):d=x0
  99. 395 if peek(v1)and 16 then if e<109 then e=fn h((d-14)/8+a)*8+m:i=i-.1:goto 415
  100. 400 h=peek(v0):e=e-f*i:if e>237 then poke s+18,0:poke s+18,17:f=-p(p):e=y0
  101. 405 if h and 16 then if not h and 1 then i=i-.4:poke s+11,0:poke s+11,129
  102. 410 if e<126 and e>120 then if d<211 and d>205 then 435
  103. 415 d=int(d+.5):y%=e+.5:gosub 9:poke v+8,d-c:poke v+9,y%:next
  104. 420 if peek(v1)and 16 then if e<109 then poke v+9,y%+3:e=e+3
  105. 425 if e<160 then if d<250 and d>170 then poke 1448,87:poke v+21,246:goto 380
  106. 430 poke 1448,32:poke v+21,247:goto 380
  107. 434 rem
  108. 435 poke v+8,208:poke v+9,123:gosub 650:poke s+12,0:poke s+13,89:poke v+32,2
  109. 440 poke s+11,0:poke s+11,65:gosub 490:poke v+33,8:gosub 490:poke v+32,11
  110. 445 gosub 490:poke v+33,9:gosub 490:poke v+21,0:poke s+11,0:poke s+13,0:next n
  111. 450 for i=1 to ss:sm(i)=sm(i)+s(i):if s(i)<bs(i)then bs(i)=s(i)
  112. 455 next:print"[147]":poke v+33,8:on ss gosub 700,705
  113. 460 print tab(5)"from the front.... key v":print tab(5)"(oints : 0)"
  114. 465 print tab(5)"continue.......key v or fire "
  115. 470 get a$:if peek(j)and 16 then if a$<>"v"and a$<>"v"then 470
  116. 475 if a$="v"then 60
  117. 480 goto 95
  118. 489 rem
  119. 490 for i=0 to 3:for f=20 to 50:poke s+8,f:next:next:return
  120. 499 rem
  121. 500 poke s+5,9:pokes+6,58:poke v+32,8:poke s+4,0:poke s+4,129
  122. 505 for i=10 to m step.3:poke s+1,i:next:poke v+32,11
  123. 510 for i=25 to 70 step.3:poke s+1,i:next:poke v+32,8:poke s+4,128
  124. 515 for i=0 to 300:next:poke s+5,5:poke v+32,11:goto 255
  125. 549 rem
  126. 550 poke s+1,w:poke s+5,2:poke s+4,32:poke z,r(u):poke s+4,33:poke s+1,30
  127. 555 f=not peek(j):if f and 16 then 595
  128. 560 if f and 4 then p=p+(p=m)*p+1:goto 635
  129. 565 if f and 8 then 630
  130. 570 get a$:if a$=""then 555
  131. 575 if a$="[157]"then p=p+(p=m)*p+1:goto 635
  132. 580 if a$=""then 630
  133. 585 if a$<>" "then 555
  134. 590 for i=0 to 180:next
  135. 595 i=853:t=0:g=2:s(n)=s(n)+1
  136. 600 if g>13 then g=g^1:goto 620
  137. 605 g=g+.23:if t>7 then t=0:i=i+1:if i=856 then i=1011
  138. 610 if i=1013 then f=g(t)or 1:poke i,f:poke i+3,f:poke i+6,f:goto 620
  139. 615 poke i,g(t):poke i+3,g(t):poke i+6,g(t)
  140. 620 t=t+1:get a$:if not peek(j)and 16 or a$=" "then 600
  141. 625 t=p(p+10):on ss gosub 670,685:poke s+4,0:poke s+5,5:return
  142. 630 p=p-(p=0)*m-1
  143. 635 y%=11-9*p(p):x%=11.5+10*p(p+10):a%=x%/8:u=x%and 7
  144. 640 poke z,0:z=896+a%+3*y%:poke z,r(u):goto 555
  145. 649 rem
  146. 650 poke 1019,1:poke 1016,1:poke 1013,1:poke 1018,0:poke 1015,0:poke 1012,0
  147. 655 poke 1017,0:poke 1014,0:poke 1011,0:poke 861,0:poke 858,0:poke 855,0
  148. 660 poke 860,0:poke 857,0:poke 854,0:poke 859,128:poke856,128:poke853,128:return
  149. 669 rem
  150. 670 print""
  151. 675 print tab(9)"game "sp tab(24)"[146]strokes :"s(1):return
  152. 679 rem
  153. 680 poke 1041+n*24,81:poke 55313+n*24,15
  154. 685 print""
  155. 690 print"1.player "s(1)tab(18)""sp"[157] "tab(26)"[146]2.player "s(2):return
  156. 699 rem
  157. 700 gosub675:printtab(13)"best game   "bs(1):printtab(13)"total"sm(1):return
  158. 704 rem
  159. 705 gosub690:print" best"bs(1)tab(25)"best"bs(2)
  160. 710 print" total"sm(1)tab(25)"total"sm(2):return
  161. 755 data-88,-89,-90,-50,-10,30,70,71,72,32,-8,-9,-85,-86,-87,-47,-7,33,73,74
  162. 760 data 75,35,-5,-45,-84,-44,-4,36,76,77,78,79,39,-1,,-41,-81,-80,-79
  163. 765 data 192,128,160,99,96,192,227,119,48,224,247,120,24,240,248,226
  164. 770 data 12,248,98,249,6,252,121,239,3,254,111,228,3,255,100,160
  165. 774 rem
  166. 775 data.001,.156,.309,.454,.588,.707,.809,.891,.951,.986,.999
  167. 779 rem
  168. 780 data 226,57,200,166,8,74,162,57,206,162,32,66,226,57,194
  169. 785 data 8,66,16,255,255,255,128,,,128,,,128,,,255,255,255
  170. 789 rem
  171. 790 data 115,156,231,66,4,165,115,136,231,18,136,161,115,136,231
  172. 795 data 132,33,8,255,255,255,,,1,,,1,,,1,255,255,255,
  173. 799 rem
  174. 800 data,12,,,13,,,13,64,,13,64,,13,16,,13,84,,13,80,,13,,
  175. 805 data 12,,,12,,,12,,,12,,,12,,,12,,,12,,,63
  176. 809 rem
  177. 810 data 8,,,8,,,42,,,34,,,168,128,,170,128,2,170,128,2,170
  178. 815 data 160,10,46,160,10,190,168,10,62,40,,60,,,60,,,60,,
  179. 819 rem
  180. 820 data,170,,2,170,128,10,170,168,10,42,168,42,168,168,34,130,170,42,42
  181. 825 data 170,40,170,42,168,138,170,162,40,162,40,170,170,170,170,168,138,186
  182. 830 data 160,170,186,,40,60,,,60,,,60,,,60,,,60,,,60,,,60,,
  183. 834 rem
  184. 835 data 31,240,,59,254,,59,255,,125,207,128,124,191,224,126,127,224,223,127
  185. 840 data 112,227,63,176,125,63,176,62,30,112,1,153,176,,3,224,,1,224,
  186. 845 data,,24,,,118,,,205,,,240,,,,,,,,,,,,
  187. 849 rem
  188. 850 data,,,4,,,4,,,2,48,,3,64,,1,128,,32,128
  189. 855 data 128,28,192,64,2,192,64,1,225,128,0,102,64,,124,,,120,,
  190. 860 data 112,,6,112,,9,240,,48,240,,,112,0,,112,,,112,,,112,,
  191. 864 rem
  192. 865 data,2,170,,,,,85,85,,,,10,170,170,,,,5,85
  193. 870 data 85,,,,42,170,170,,,,85,85,85,,,,42,170,168,
  194. 875 data,,85,85,80,,,,170,170,128,,,,85,85,64,,,,170,170,,
  195.