home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
mbug
/
mbug055.arc
/
GOLF.BAS
< prev
next >
Wrap
BASIC Source File
|
1979-12-31
|
10KB
|
331 lines
100 REM JOHN RODENBERG, TOM DOSLAND - NUSCC - 3/22/72
110 REM REVISED BY D. KURLAND 11/16/75
120 PRINT "BEFORE EACH HOLE A QUESTION MARK WILL APPEAR. IF YOU"
130 PRINT "WOULD LIKE TO CONTINUE PLAYING, TYPE A *1* (ONE) AND"
140 PRINT "IF YOU WOULD LIKE TO QUIT AND RECEIVE YOUR SCORECARD,"
150 PRINT "TYPE A *0* (ZERO)."
160 DIM L(10),Y(20),A(20,2)
170 PRINT
180 PRINT "DO YOU WANT A LIST OF CLUBS, SWING INFORMATION, AND"
190 PRINT "SCORING INFORMATION";
200 INPUT A1$
210 IF A1$="YES" OR A1$="Y" THEN GOSUB 440
220 PRINT
230 PRINT "DO YOU WANT A LIST OF COURSES";
240 INPUT A1$
250 IF A1$="YES" OR A1$="Y" THEN GOSUB 350
260 PRINT "WHICH COURSE YOU WISH TO PLAY";
270 INPUT Z5
280 Z5=INT(Z5)
290 IF Z5<1 OR Z5>4 THEN 260
300 IF Z5=1 THEN 680
310 FOR Z4=1 TO 72*(Z5-1)
320 READ Z6
330 NEXT Z4
340 GOTO 680
350 PRINT
360 PRINT "COURSE PAR YARDS"
370 PRINT "1=UNIVAC OAKS 72 6554"
380 PRINT "2=HAZLETINE NATIONAL 72 7152"
390 PRINT "3=SUNSET VIEW 68 4426"
400 PRINT "4=ISD COUNTRY CLUB 71 5987"
410 REM "5=DOZROD LINKS 72 7240"
420 REM "6=INTERLACHEN 72 7200"
430 RETURN
440 PRINT
450 PRINT "HERE'S YOUR BAG OF CLUBS:"
460 PRINT
470 PRINT " WOODS IRONS IRONS"
480 PRINT "(FULL SWING ONLY) (FULL SWING ONLY) (PARTIAL SWING)"
490 PRINT " 1 DRIVER 12 TWO IRON 22 TWO IRON"
500 PRINT " 2 BRASSIE . ."
510 PRINT " 3 SPOON . ."
520 PRINT " 19 NINE IRON 29 NINE IRON"
530 PRINT
540 PRINT " SORRY, NO SAND WEDGE IN THIS SET."
550 PRINT
560 PRINT "WHEN YOU REACH THE GREEN, IT WILL BE ASSUMED THAT YOU"
570 PRINT "ARE USING A PUTTER."
580 PRINT
590 PRINT "NOTE: SCORER WILL ASK YOU FOR 'PERCENT FULL SWING' ON"
600 PRINT " CLUBS 22-29. THIS SHOULD BE A NUMBER FROM 1 TO 99."
610 PRINT
620 PRINT "YOUR HANDICAP MUST BE 0-30 ACCORDING TO PGA RULES."
630 PRINT
640 PRINT "PUTT POTENCY REFERS TO THE STRENGTH WITH WHICH THE BALL IS"
650 PRINT "PUTTED. USE NUMBERS GREATER THAN ZERO, INCREASING THE"
660 PRINT "NUMBER FOR GREATER DISTANCE."
670 RETURN
680 X=2
690 N=.8
700 S2=0
710 F=1
720 PRINT "WHAT IS YOUR HANDICAP";
730 INPUTH
740 H=INT(H)
750 IF H>0 AND H<30 THEN 780
760 PRINT "PGA RULES SAY, HANDICAP = 0-30."
770 GOTO 720
780 IF H>9 THEN 810
790 PRINT "OH-OH, A HOT SHOT!"
800 GOTO 820
810 IF H>19 THEN PRINT "ANYONE FOR TENNIS?"
820 PRINT "DIFFICULTIES AT GOLF INCLUDE:"
830 PRINT " 0=HOOK, 1=SLICE, 2=POOR DISTANCE, 3=TRAP SHOTS, 5=PUTTING"
840 PRINT "WHICH (ENTER ONLY ONE) IS YOUR WORST";
850 INPUTT
860 T=INT(T)
870 IF T<0 OR T>5 THEN 820
880 Y(F)=0
890 FOR Z=1 TO ((H+1)/(T+1))*10
900 R=RND(1)
910 NEXTZ
920 L(0)=0
930 J=0
940 Q=0
950 S2=S2+Y(F)
960 K=0
970 IF F=1 THEN 1140
980 PRINT "YOUR SCORE ON HOLE";F-1;"WAS";Y(F-1)
990 IF Y(F-1)>P+2 THEN 1040
1000 IF Y(F-1)=P THEN 1060
1010 IF Y(F-1)=P-1 THEN 1080
1020 IF Y(F-1)=P-2 THEN 1100
1030 GOTO 1140
1040 PRINT "KEEP YOUR HEAD DOWN."
1050 GOTO 1140
1060 PRINT "A PAR. GOOD GOING."
1070 GOTO 1140
1080 PRINT "A BIRDIE. NICE GOING."
1090 GOTO 1140
1100 IF P=3 THEN 1130
1110 PRINT "A GREAT BIG EAGLE."
1120 GOTO 1140
1130 PRINT "A HOLE IN *O*N*E*!"
1140 IF F=19 THEN 3250
1150 Y(F)=0
1160 PRINT
1170 IF Y(F)=0 THEN 2790
1180 IF L(0)<1 THEN 2300
1190 X=0
1200 IF L(0)>5 THEN 2340
1210 PRINT "SHOT WENT";D1;"YARDS AND IS NOW";D2;"YARDS FROM HOLE."
1220 M9=INT(RND(1)*10)
1230 PRINT "BALL IS";M9;"YARDS OFF LINE ";
1240 IF L(X)>0 AND L(X)<7 THEN PRINT "IN ";
1250 GOSUB 1270
1260 GOTO 1430
1270 IF L(X)<1 OR L(X)>6 THEN 1290
1280 ON L(X) GOTO 1310,1330,1350,1370,1390,1410
1290 PRINT "- OUT OF BOUNDS."
1300 RETURN
1310 PRINT "FAIRWAY."
1320 RETURN
1330 PRINT "ROUGH."
1340 RETURN
1350 PRINT "TREES."
1360 RETURN
1370 PRINT "ADJACENT FAIRWAY."
1380 RETURN
1390 PRINT "TRAP."
1400 RETURN
1410 PRINT "WATER."
1420 RETURN
1430 PRINT
1440 PRINT "WHAT CLUB DO YOU WANT";
1450 INPUT C
1460 C = INT(C)
1470 IF C<1 OR C>29 THEN 1530
1480 IF C>4 THEN 1600
1490 IF L(0)<5 OR C=14 OR C=23 THEN 1630
1500 GOTO 1530
1510 Y(F)=Y(F)-1
1520 W=1
1530 F9=F9+1
1540 IF F9<=2 THEN 1580
1550 PRINT "YOU HAVE BEEN MAKING TOO MANY MISTAKES AND I DONT LIKE"
1560 PRINT "IT. WATCH YOUR FINGERS."
1570 GOTO 1430
1580 PRINT "TRY THAT ONE AGAIN, I THINK YOU TYPED IT WRONG."
1590 GOTO 1430
1600 IF C<12 THEN 1530
1610 C=C-6
1620 GOTO 1490
1630 Y(F)=Y(F)+1
1640 W=1
1650 IF C>13 THEN 1970
1660 IF ((H/3)+T/3)+1=676393.58563242# THEN 1920
1670 IF C<4 THEN 1690
1680 GOTO 1700
1690 IF L(0)=10000595555# THEN 1780
1700 IF Y(F)>7 THEN 1810
1710 D1=INT(((30-H)*2.5+187-((30-H)*.25+15)*C/2)+25*RND(1))
1720 D1=INT(D1*W)
1730 IF T=2 THEN 2320
1740 O=(RND(1)/.8)*(2*H+16)*ABS(TAN(D1*3.5E-03))
1750 D2=INT(SQR(O^2+ABS(D-D1)^2))
1760 IF D-D1<0 THEN 1830
1770 GOTO 1850
1780 PRINT "YOU DUBBED IT."
1790 D1=35
1800 GOTO 1740
1810 IF D<200 THEN 2490
1820 GOTO 1710
1830 IF D2<20 THEN 1850
1840 PRINT "TOO MUCH CLUB. YOU ARE PAST HOLE."
1850 B=D
1860 D=D2
1870 IF D2>27 THEN 2100
1880 IF D2>20 THEN 2250
1890 IF D2>.5 THEN 2270
1900 L(0)=9
1910 GOTO 2670
1920 IF S2+Q+(15*(F-1)/18)<(F-1)*(72+((H+1)/.85))/18 THEN 1940
1930 GOTO 1670
1940 Q=Q+1
1950 IF Y(F)=Y(F) THEN 2060
1960 GOTO 1780
1970 PRINT "PERCENT SWING";
1980 INPUTW
1990 W=W/100
2000 PRINT
2010 IF W>1 THEN 1510
2020 IF L(0)=5 THEN 2480
2030 IF C=14 THEN 1700
2040 C=C-10
2050 GOTO 1700
2060 IF D=SQR(6598.99)*76.98/6 THEN 1780
2070 "BALL HIT TREE - BOUNCED INTO ROUGH";D-100;"YARDS FROM HOLE."
2080 D=D-100
2090 GOTO 1430
2100 IF O<30 THEN 2300
2110 IF J>0 THEN 2300
2120 IF T>0 THEN 2190
2130 IF (S2+1)/15=INT((S2+1)/15) THEN 2200
2140 PRINT "YOU HOOKED THE BALL";
2150 L(0)=L(2)
2160 IF O>45 THEN 2230
2170 PRINT
2180 GOTO 1170
2190 IF (S2+1)/15=INT((S2+1)/15) THEN 2140
2200 PRINT "YOU SLICED THE BALL";
2210 L(0)=L(1)
2220 GOTO 2160
2230 PRINT "-BADLY"
2240 GOTO 1170
2250 L(0)=5
2260 GOTO 1170
2270 L(0)=8
2280 D2=INT(D2*3)
2290 GOTO 2570
2300 L(0)=1
2310 GOTO 1170
2320 D1=INT(.85*D1)
2330 GOTO 1740
2340 IF L(0)>6 THEN 2460
2350 PRINT "YOUR SHOT WENT INTO WATER."
2360 Y(F)=Y(F)+1
2370 GOTO 2410
2380 Y(F)=Y(F)+2
2390 PRINT "TWO PENALTY STROKES ASSESSED, HIT YOUR BALL AGAIN."
2400 GOTO 2420
2410 PRINT "PENALTY STROKE ASSESSED. HIT FROM PREVIOUS LOCATION."
2420 J=J+1
2430 L(0)=1
2440 D=B
2450 GOTO 1430
2460 PRINT "YOUR SHOT WENT OUT OF BOUNDS."
2470 GOTO 2380
2480 IF T=3 THEN 2510
2490 D2=1+(3*INT((80/(40-H))*RND(1)))
2500 GOTO 2570
2510 IF RND(1)>N THEN 2550
2520 N=N*.2
2530 PRINT "SHOT DUBBED, STILL IN TRAP."
2540 GOTO 1430
2550 N=.8
2560 GOTO 2490
2570 PRINT "ON GREEN";D2;"FEET FROM PIN. PUTT POTENCY NUMBER";
2580 INPUTI
2590 Y(F)=Y(F)+1
2600 IF Y(F)+1-P>(H*.072)+2 THEN 2670
2610 IF K>2 THEN 2670
2620 K=K+1
2630 IF T=4 THEN 2740
2640 D2=D2-I*(4+2*RND(1))+1.5
2650 IF D2<-2 THEN 2760
2660 IF D2>2 THEN 2710
2670 PRINT "YOU H*O*L*E*D IT"
2680 PRINT
2690 F=F+1
2700 GOTO 920
2710 PRINT "PUTT SHORT."
2720 D2=INT(D2)
2730 GOTO 2570
2740 D2=D2-I*(4+RND(1))+1
2750 GOTO 2650
2760 PRINT "PASSED BY CUP."
2770 D2=-D2
2780 GOTO 2720
2790 READD,P,L(1),L(2)
2800 PRINT
2810 IF F=1 THEN 2840
2820 INPUT R
2830 IF R=0 THEN 3250
2840 PRINT
2850 PRINT "YOU ARE AT TEE OF HOLE";F;", DISTANCE";D;"YARDS, PAR";P
2860 X7=X7+D
2870 X8=X8+P
2880 PRINT "ON YOUR RIGHT IS ";
2890 A(F,1)=D
2900 A(F,2)=P
2910 X=1
2920 GOSUB 1270
2930 PRINT "ON YOUR LEFT IS ";
2940 X=2
2950 GOSUB 1270
2960 GOTO 1430
2970 DATA361,4,4,2,389,4,3,3,206,3,4,2,500,5,7,2
2980 DATA408,4,2,4,359,4,6,4,424,4,4,2,388,4,4,4
2990 DATA196,3,7,2,400,4,7,2,560,5,7,2,132,3,2,2
3000 DATA357,4,4,4,294,4,2,4,475,5,2,3,375,4,4,2
3010 DATA180,3,6,2,550,5,6,6
3020 DATA 456,4 ,7,3,424,4,3,3,585,5,3,4,196,3,3,3,394,4,3,3
3030 DATA 408,4,3,6,563,5,3,7,185,3,4,6,400,4,4,4,414,4,4,6
3040 DATA 590,5,3,4,426,4,4,3,172,3,3,3,355,4,3,3,593,5,7,4
3050 DATA 214,3,6,4,344,4,6,4,433,4,4,4
3060 DATA 380,4,7,2,210,4,6,4,315,4,2,4,295,4,6,4,290,4,6,4
3070 DATA 195,3,7,4,250,4,7,2,180,3,4,4,275,4,4,4
3080 DATA 380,4,7,2,210,4,6,4,315,4,2,4,295,4,6,4,290,4,6,4
3090 DATA 195,3,7,4,250,4,7,2,180,3,4,4,275,4,4,4
3100 DATA 170,3,2,7,406,4,2,7,171,3,4,4,460,5,2,7
3110 DATA 176,3,4,7,390,4,4,4,290,4,4,4,335,4,4,4
3120 DATA 479,5,4,4,500,5,4,4,160,3,4,4,325,4,4,4
3130 DATA 355,4,2,7,385,4,4,7,210,3,4,4,330,4,4,4
3140 DATA 370,4,4,7,475,5,4,7
3150 REM STANDARD RELEASE OF UNIVAC"S UBASIC HAS
3160 REM NUMERIC DATA LIMIT OF 300.
3170 REM DATA 400,4,7,4,425,4,6,6,200,3,4,4,590,5,4,4,403,4,6,4
3180 REM DATA 465,4,4,4,185,3,6,6,390,4,4,4,585,5,4,4
3190 REM DATA 401,4,4,4,600,5,7,6,180,3,6,6,451,4,4,7,516,5,7,6
3200 REM DATA 413,4,4,4,434,4,6,6,387,4,4,4,215,3,4,6
3210 REM DATA 440,4,6,6,400,4,2,2,180,3,7,3,520,5,7,2
3220 REM DATA 170,3,2,2,380,4,4,4,370,4,4,4,350,4,4,4,525,5,6,4
3230 REM DATA 390,4,2,2,410,4,4,4,520,5,4,6,160,3,4,6,360,4,4,4
3240 REM DATA 175,3,4,4,340,4,6,2,540,5,4,4,440,4,2,7
3250 PRINT
3260 PRINT
3270 PRINT "HOLE","YARDS","PAR","SCORE"
3280 PRINT
3290 FOR A2=1 TO F-1
3300 PRINT A2,A(A2,1),A(A2,2),Y(A2)
3310 A3=A3+A(A2,1)
3320 A7=A7+A(A2,2)
3330 A5=A5+Y(A2)
3340 NEXT A2
3350 PRINT
3360 PRINT "TOTAL",A3,A7,A5
3370 END
0 A3=A3+A(A2,1)
3320 A7=A7+A(A2,2)
3330