10 PRINT TAB(25);"BOCCE" 20 PRINT TAB(19);"CREATIVE COMPUTING" 30 PRINT TAB(17);"MORRISTOWN NEW JERSEY" 40 PRINT:PRINT:PRINT 1000 Q=5 1010 PRINT "THIS GAME SIMULATES THE GAME OF LAWN BOWLS" 1020 INPUT "DO YOU NEED INSTRUCTIONS? ENTER YES OR NO";Z\$ 1030 DIM B(9),B1(9),D(9),V(9),X(9),Y(9) 1040 PRINT: IF Z\$="YES" THEN GOSUB 1770 1045 P1=3.14159 1050 S1=0:S2=0:A=-49.3 1070 X(1)=INT(2000+700*RND(1)): Y(1)=INT(200-400*RND(1)) 1080 PRINT "THE JACK IS LOCATED AT ";X(1);Y(1) 1090 FOR P=2 TO Q 1100 J=P:GOSUB 1570 1110 NEXT P 1120 FOR J=2 TO Q 1130 D1=D1+D(J) 1140 NEXT J 1150 PRINT: PRINT "THE TOTAL DISTANCE OF ALL BALLS FROM THE JACK IS "; 1155 PRINT D1;" CM" 1160 IF D1 < Q^2 THEN PRINT "MAGNIFICENT BOWLING! WHAT AN EYE!!" 1165 IF D1 < Q^2 THEN 1230 1170 IF D1<2*Q^2 THEN PRINT"EXCELLENT BUT COULD BE BETTER:":GOTO 1230 1180 IF D1 < 3*Q^2 THEN PRINT "GOOD BUT NEEDS SOME IMPROVEMENT":GOTO1230 1190 IF D1 < 6*Q^2 THEN PRINT "FAIR - YOU NEED MORE PRACTICE":GOTO 1230 1200 IF D1 < 10*Q^2 THEN PRINT "POOR - TRY TO BE MORE CONSISTANT":GOTO 1230 1210 IF D1 < 20*Q^2 THEN PRINT "YOUR GAME NEEDS LOTS OF WORK":GOTO 1230 1220 PRINT "DON'T PLAY THIS GAME FOR MONEY!!" 1230 FOR J=1 TO Q 1232 B(J)=0:B1(J)=0:D(J)=0 1240 V(J)=0:X(J)=0:Y(J)=0 1250 NEXT J 1260 PRINT:INPUT "CARE TO TRY AGAIN? ENTER YES OR NO";Y\$ 1270 PRINT: IF Y\$="YES" THEN 1050 1280 GOTO 1890 1290 K1=-20 1295 IF J=1 THEN K1=0 1300 A1=A*COS(B(J))+K1*COS((P1/2)+B(J)) 1305 A2=A*SIN(B(J))+K1*SIN((P1/2)+B(J)) 1310 S3=V(J)*COS(B(J))*.05+1.25E-03*A1 1315 S4=V(J)*SIN(B(J))*.05+1.25E-03*A2 1320 B(J)=ATN((V(J)*SIN(B(J))+A2*.05)/(V(J)*COS(B(J))+A1*.05)) 1330 IF B1(J)< 0 THEN S4=-S4 1340 S5=S1+S3: S6=S2+S4 1350 IF J=1 THEN 1370 1360 IF ABS(S5-X(1))<7 AND ABS(S6-Y(1))<7 THEN K=1:GOSUB 1550 1370 FOR K=2 TO Q 1380 IF K=J OR X(K)=0 THEN 1400 1390 IF ABS(S5-X(K))< 10 AND ABS(S6-Y(K))< 10 THEN GOSUB 1500 1400 NEXT K 1410 IF V(J)ABS(A*.05) THEN J=L:GOTO 1290 1470 B(L)=0:V(L)=0 1480 NEXT L 1490 GOTO 1630 1500 B(K)=ATN((Y(K)-S2)/(X(K)-S1)): PRINT CHR\$(7); 1510 IF J=1 THEN V(J)=V(J)/5 1520 V(J)=ABS(V(J)*SIN(B(J)-B(K))):V(K)=ABS(V(J)*COS(B(J)-B(K))) 1530 B(J)=((P1/2)+B(K)): S5=S1: S6=S2 1540 IF K=1 THEN V(K)=5*V(K) 1550 IF J=1 THEN V(J)=5*V(J) 1560 RETURN 1570 PRINT "BALL ";(J-1) 1580 INPUT "VELOCITY";V(J):V(J)=ABS(V(J)) 1590 IF V(J) > 1000 THEN PRINT "VELOCITY TOO HIGH":GOTO 1580 1600 INPUT "ANGLE";B1(J) 1610 IF ABS(B1(J))> 89 THEN PRINT "ANGLE TO BIG":GOTO 1290 1620 PRINT : B(J)=ABS(B(J)*P1/180):GOTO 1290 1630 PRINT "JACK AT COORDINATES ";X(1);Y(1) 1640 FOR M=2 TO P 1650 D=(SQR((Y(1)-Y(M))^2+(X(1)-X(M))^2))-7 1655 D(M)=D 1660 IF D < 0 THEN D(M)=0 1670 PRINT"BALL ";(M-1);" AT COORDINATES ";X(M);Y(M);" IT IS ";D(M); 1675 PRINT "FROM THE JACK" 1680 NEXT M 1690 PRINT 1700 IF D(P) < 10 THEN PRINT TAB(15);"EXCELLENT SHOT! ";:GOTO 1740 1710 IF D(P) < 20 THEN PRINT TAB(15);"GOOD SHOOTING! ";:GOTO 1740 1720 IF D(P)< 30 THEN PRINT TAB(15);"NICE TRY !";:GOTO 1740 1730 IF D(P)>500 THEN PRINT TAB(5);"YECH! OVER ";INT(D(P)/30.48); 1735 IF D(P) > 500 THEN PRINT "FEET AWAY!" 1740 IF X(P)>X(1) THEN PRINT "LONG AND "; 1745 IF X(P)< X(1) THEN PRINT "SHORT AND "; 1750 IF Y(P)>Y(1) THEN PRINT "TO THE LEFT " 1755 IF Y(P) < Y(1) THEN PRINT "TO THE RIGHT" 1760 PRINT 1765 RETURN 1770 PRINT "IN THIS GAME YOU ROLL ";Q-1;"BALLS SUCCESSIVELY AT A TARG"; 1775 PRINT "ET" 1780 PRINT "BALL (CALLED A JACK). THE OBJECT IS TO GET THE BALLS AS CLOSE" 1790 PRINT "TO THE JACK AS POSSIBLE. THE BALLS ARE 10 CM IN DIAMETER AND" 1800 PRINT "ARE WEIGHTED SO THAT THEY ROLL IN A CURVE. YOU WILL HAVE TO" 1810 PRINT "ROLL THEM AT AN ANGLE TO THE LINE FROM YOU AT COORDINATES 0,0" 1820 PRINT "TO THE JACK AT COORDINATES X,Y. A POSITIVE ANGLE WILL MAKE" 1830 PRINT "THE BALL CURVE CLOCKWISE. A NEGATIVE ANGLE WILL MAKE IT CURVE" 1840 PRINT "ANTI-CLOCKWISE. THE JACK IS A 4 CM WIDE AND WILL ROLL" 1850 PRINT "STRAIGHT IF YOU HIT IT. BALLS HIT BY YOUR THROWN BALL MAY" 1860 PRINT "CURVE IN EITHER DIRECTION." 1870 PRINT:PRINT "HINT. TRY AN INITIAL VELOCITY OF 500 AND AN ANGLE OF 10" 1880 PRINT:PRINT:RETURN 1890 END