Post by Stefan Pendl on Jul 5, 2021 5:52:31 GMT -5
The following code results in a label not found error for the second time a club is entered.
The same code works fine in LB 4.5.1
Thanks in advance for a fix
The same code works fine in LB 4.5.1
' golf 64 style
[startCourse]
' poke 53280,13:poke 53281,5
q=0:t=0
for h=1 to 18
e=0
read d,p
q=q+p
[nextStroke]
cls
print space$(10); "this is hole: ";h
print space$(5); "number of strokes so far: ";t
print space$(8); "par after this hole: ";q
if e>0 then print space$(10); "strokes taken: ";e
print space$(12); "distance: ";d
if d=0 then goto [holeFinished]
if d<20 then goto [onGreen]
[chooseClub]
input ""; space$(3); "which club will you use (1-8): "; c
if c<1 or c>8 then goto [chooseClub]
r=int(c*20*(rnd(1)+.5))
gosub [hit]
print space$(11); "you hit ";r;" yards"
d=abs(d-r)
e=e+1
t=t+1
call delay 3000
goto [nextStroke]
[onGreen]
print space$(8); "you are on the green"
call delay 3000
z=int(d/6)+1
print space$(10); "you took ";z;" putts"
e=e+z
[holeFinished]
t=t+z
print space$(9); "number of strokes ";e
call delay 2500
next h
cls' :poke 53280,5:poke 53281,13
print space$(10); "your score is ";t
print space$(4); "the par for this course was ";q
input ""; space$(3); "do you want another round (y/n): "; a$
if lower$(a$)="n" then end
restore
goto [startCourse]
[hit]
' poke 54296,15
' poke 54277,17:poke 54278,17
' poke 54276,17
' poke 54273,12:poke 54272,216
call delay 50
' poke 54277,0:poke 54278,0:poke 54276,0
return
' st andrews old course
data 373,4,446,4,400,4,479,4,546,5,412,4,381,4,190,3,349,4,385,4,181,3,352,4
data 463,4,604,5,455,4,418,4,500,4,358,4
sub delay milliseconds
timer milliseconds, [finish]
wait
[finish]
timer 0
end sub
Thanks in advance for a fix