Hello,
I have a book called "SS Advanced Computer Programs in Basic" and there is a program called "Horse". The program has 5 horses and they each race, and a random horse wins the race everytime.
I have copied each line and the program wont run, there is many errors and I don't know why there is errors since I copied it from the programming book.
Here is the code :
SmalBasic shows that the first error is on line 70, while Libertybasic shows that the first error is on line 50. And there are more errors. I am currently using Liberty Basic.Code:10 rem * press space bar to start the race or press 'M' key 20 rem * to have a horse die during the race 30 cls:print chr$(23);:input "press enter to start the race ";A$:CLS 40 DIM A(15):goto 250 50 cls:for A=1 to 14:read A(A):next a:for B=1 to 7:if B(B)<>2 then B(B)=0:next B 60 data 14,0,14,6,14,12,14,18,14,24,14,30,14,36 70 X=120:for Y=0 to 40 step 2:set(X,Y):next Y 80 for c=1 to 13 step 2:X=A(C):Y=A(C+1):gosub 390:next C 90 F=0:for C=1 to 7:print@F,C:F=F+128:next C 100 print @916, "get set . . .!"; 110 for X=1 to 2500:next X:print @916,"and they're off!!"; 120 for C=1 to 13 step 2 130 V=C:gosub 310:if B(M)=1 goto 170 140 if M=R3 and A(C)=R4 and B(M)<>2 then B(M)=1:goto 520 150 if B(M)=1 goto 170 160 W=rnd(2):if W=2 then A(C)=A(C)+3 170 next C 180 for V=1 to 13 step 2:gosub 310:X=A(V):Y=A(V+1):if B(M)=1 goto 190else gosub 390 190 next V 200 goto 120 210 for R=60 to 828 step 64:print@R,"*";:next R 220 print@916,"the race is over!!!";:for X=1 to 1000:next X 230 for X=1 to 1000:next X 240 cls:for P=1 to 250:next P 250 cls:print chr$(23);"W I N N E R:" print "H O R S E # ";M 260 restore 270 E$=inkey$ 280 if E$=" " then clear:dim A(15):goto 50 290 if E$="M" then clear:dim A(15):goto 470 300 for P=1 to 250:next P:goto 240 310 if V=1 then M=1 320 if V=3 then M=2 330 if V=5 then M=3 340 if V=7 then M=4 350 if V=9 then M=5 360 if V=11 then M=6 370 if V=13 then M=7 380 return 390 set(X,Y):set(X-1,Y) 400 for Z=X-7 to X-1:set(Z,Y+1):next Z 410 set(X-8,Y+2):set(X-1,Y+2) 420 reset(X-3,Y):reset(X-4,Y) 430 reset(X-8,Y+1):reset(X-9,Y+1):reset(X-10,Y=1) 440 reset(X-4,Y+2) 450 if X>=120 gosub 310:goto 210 460 return 470 R3=rnd(7):R4=rnd(50)+14 480 R=14 490 if R4=R goto 510 500 R=R+3:if R>70 goto 470 else goto 490 510 goto 50 520 X=A(C):Y=A(C+1) 530 reset(X,Y):reset(X-1,Y) 540 for B5=X-8 to X:reset(B5,Y+1):next B5 550 for B5=X-9 to X:reset(B5,Y+2):next B5 560 set (X-2,Y+1):set(X-9,Y=1) 570 for G=X-8 to X-2:set(G,Y+2):next G 580 set (X,Y+3):set(X-1,Y+3) 590 goto 150
Help me please.
Thanks.
Kidcash.


LinkBack URL
About LinkBacks




Reply With Quote


Bookmarks
Algorithms and Data Structures
Java tutorials
Algorithms Forum