home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Education
/
collectionofeducationcarat1997.iso
/
SPORT
/
GOLF96B.ZIP
/
GOLF96.BAS
< prev
next >
Wrap
BASIC Source File
|
1996-03-09
|
17KB
|
439 lines
100 'GOLF96 BY PHILIP VLASAK MARCH 9, 96
110 REM CONVERTED BY STEVE ESTLE
120 ESCAPE = 27
130 KEY OFF: CLS
140 RANDOMIZE TIMER
150 DIM A$(25),FIRST(9)
160 ON ERROR GOTO 4060
170 DATFILE$="GOLF96.SAV": OPEN DATFILE$ FOR INPUT AS #1
180 INPUT #1,SCORE,PLAYERNAME$,SOUNDSET$:CLOSE #1
190 A$(1)="1ST TEE"
200 A$(2)="2ND TEE"
210 A$(3)="3RD TEE"
220 A$(4)="4TH TEE"
230 A$(5)="5TH TEE"
240 A$(6)="6TH TEE"
250 A$(7)="7TH TEE"
260 A$(8)="8TH TEE"
270 A$(9)="9TH TEE"
280 A$(10)="10TH TEE"
290 A$(11)="11TH TEE"
300 A$(12)="12TH TEE"
310 A$(13)="13TH TEE"
320 A$(14)="14TH TEE"
330 A$(15)="15TH TEE"
340 A$(16)="16TH TEE"
350 A$(17)="17TH TEE"
360 A$(18)="18TH TEE"
370 GOSUB 4130 ' TO CLUB NAME
380 PRINT
390 PRINT "WELCOME TO THE ";CLUBNAME$;" COUNTRY CLUB"
400 PRINT
410 PRINT "THE LOCAL PRO IS ";PLAYERNAME$
420 PRINT "WITH A RECORD SCORE OF";SCORE;"UNDER PAR."
430 PRINT
440 PRINT "ARE YOU A NEW MEMBER OF THE ";CLUBNAME$;" CLUB? ENTER Y OR N "
450 X$=INKEY$: IF X$="" THEN 450
460 CLS: TT=1: GOSUB 4230
470 IF X$="Y" OR X$="y" THEN PRINT: GOTO 530
480 IF X$="N" OR X$="n" THEN PRINT: GOTO 910
490 IF X$=CHR$(ESCAPE) THEN GOSUB 3990
500 IF X$=CHR$(ESCAPE) THEN GOTO 440
510 PRINT "I CAN SEE YOU HAVE ALREADY SPENT CONSIDERABLE TIME AT THE 19THHOLE TRY ANSWERING AGAIN."
520 GOTO 440
530 PRINT :PRINT :PRINT
540 PRINT " YOU ARE ABOUT TO PLAY A ROUND OF GOLF AT THE NEW AND EXCITING ";CLUBNAME$;" COUNTRY CLUB."
550 PRINT
560 PRINT TAB(18)"********** THESE ARE YOUR CLUBS **********"
570 PRINT
580 PRINT TAB(26)" 4 WOODS NUMBERED 1 THROUGH 4"
590 PRINT TAB(26)" FOR HITTING AT DISTANCES OVER 180 FEET."
600 PRINT TAB(26)" 8 (EIGHT) IRONS 2 THROUGH 9"
610 PRINT TAB(26)" FOR HITTING SHORTER DISTANCES."
620 PRINT TAB(26)" A WEDGE FOR SAND TRAPS"
630 PRINT
640 PRINT TAB(26)" AND A PUTTER WHEN YOU'RE ON THE GREEN."
650 PRINT
660 PRINT " FOR THE WOODS AND IRONS, THE DISTANCE YOU HIT THE BALL"
670 PRINT " IS DETERMINED BY THE NUMBER OF THE CLUB."
680 PRINT " THE LOWER THE NUMBER, THE FARTHER WILL BE YOUR DRIVE."
690 PRINT: PRINT TAB(26)"HIT ANY KEY TO CONTINUE"
700 A$=INKEY$:IF A$="" THEN 700
710 CLS: TT=1: GOSUB 4230
720 PRINT
730 PRINT
740 PRINT "YOU PUTT BY TYPING A NUMBER FROM 0 TO 9."
750 PRINT "THE DISTANCE AND CORRECTNESS OF YOUR PUTT ARE CONTROLLED BY THE SIZE"
760 PRINT "OF YOUR NUMBER. A 0 WILL TAP THE BALL ACCURATELY,"
770 PRINT "A 9 WILL DRIVE IT APPROXIMATELY 100 FEET WITH DOUBTFUL ACCURACY."
780 PRINT: PRINT "PAR 3 IS UP TO 250 YARDS,"
790 PRINT "PAR 4 IS 251 TO 475 YARDS,"
800 PRINT "PAR 5 IS OVER 475 YARDS."
810 PRINT: PRINT "YOU CAN TYPE E OR HIT ESCAPE TO END AT ANY TIME."
820 PRINT: PRINT "ALL THE KEY SELECTIONS ARE ONE LETTER,"
830 PRINT "YOU ONLY TYPE ONE LETTER OR NUMBER TO GET ACTION."
840 PRINT
850 PRINT "YOU CAN TURN SOUND EFFECTS ON OR OFF AT ANY TIME BY TYPING S."
860 PRINT "IF YOU DON'T HAVE A SOUND CARD YOU SHOULD TURN SOUND OFF."
870 PRINT
880 PRINT TAB(26)"HIT ANY KEY TO START"
890 A$=INKEY$:IF A$="" THEN 890
900 CLS: TT=1: GOSUB 4230
910 S=S+1
920 IF S<>19 THEN 950
930 K1=2
940 GOTO 3740
950 IF S<>10 THEN 1070
960 K1=1
970 PRINT
980 PRINT
990 PRINT "DO YOU WANT TO PLAY ANOTHER NINE HOLES, "
1000 PRINT "YES OR NO "
1010 X2$=INKEY$:IF X2$="" THEN 1010
1020 TT=1: GOSUB 4230
1030 IF X2$="Y" OR X2$="y" THEN PRINT: GOTO 1070
1040 IF X2$="N" OR X2$="n" THEN PRINT: GOTO 3740
1050 PRINT :PRINT :PRINT "IF YOU PLAY LIKE YOU TYPE YOU WILL NEVER MAKE IT!"
1060 GOTO 990
1070 PRINT
1080 READ Y
1090 Y1=Y
1100 READ D
1110 PRINT "YOU ARE ON THE ";A$(S);"..."
1120 PRINT "IT IS";Y;"YARDS LONG, PAR";D
1130 C=0
1140 K=0
1150 'NEXT SHOT
1160 IF INT(Y)=0 THEN 2770
1170 C=C+1
1180 IF S+C<3 THEN 1210
1190 PRINT :PRINT "G - WEDGE, I - IRON, OR W - WOOD"
1200 GOTO 1240
1210 PRINT "TELL ME WHICH TYPE OF CLUB TO USE,"
1220 PRINT "FOR A WEDGE TYPE G, FOR AN IRON TYPE I, OR FOR A WOOD TYPE W."
1230 PRINT "FROM NOW ON I WILL JUST ASK WEDGE, IRON OR WOOD."
1240 Z$=INKEY$:IF Z$="" THEN 1240
1250 IF Z$="E" OR Z$="e" OR Z$=CHR$(ESCAPE) THEN GOSUB 3990
1260 IF Z$="E" OR Z$="e" OR Z$=CHR$(ESCAPE) THEN GOTO 1190
1270 IF Z$="S" OR Z$="s" THEN GOSUB 4250 'TO SOUND SETTING
1280 IF Z$="S" OR Z$="s" THEN GOTO 1190
1290 TT=1: GOSUB 4230
1300 IF Z$="W" OR Z$="w" THEN PRINT " ": GOTO 1800
1310 IF Z$="G" OR Z$="g" THEN PRINT " YOU CHOOSE A WEDGE": GOTO 1370
1320 IF Z$="I" OR Z$="i" THEN PRINT " ": GOTO 1460
1330 PRINT "YOU CAN ONLY CHOOSE A WEDGE, IRON OR WOOD."
1340 PRINT "FOR A WEDGE TYPE G, FOR AN IRON TYPE I, OR FOR A WOOD TYPE W."
1350 PRINT "TYPE E OR HIT ESCAPE TO END."
1360 GOTO 1240
1370 TT=1: GOSUB 4230
1380 IF Y<(18*RND+73) THEN 1410
1390 PRINT " HEY... YOU CAN'T USE A WEDGE AT THIS DISTANCE...."
1400 Z$="": GOTO 1190
1410 IF SOUNDSET$="ON" THEN SHELL "PLANY HITSAND.WAV"
1420 SEL=RND:IF SEL>.75 THEN GOTO 2620
1430 IF INT(15*RND)=13 THEN 3400 'TO SINK SHOT
1440 Y=Y-(INT(75*RND+50))
1450 GOTO 2690 'TO ON GREEN
1460 PRINT "WHAT NUMBER IRON "
1470 CLUB$=INKEY$:IF CLUB$="" THEN 1470
1480 IF CLUB$="E" OR CLUB$="e" OR CLUB$=CHR$(ESCAPE) THEN GOSUB 3990
1490 IF CLUB$="E" OR CLUB$="e" OR CLUB$=CHR$(ESCAPE) THEN GOTO 1190
1500 IF CLUB$="S" OR CLUB$="s" THEN GOSUB 4250
1510 IF CLUB$="S" OR CLUB$="s" THEN GOTO 1460
1520 TT=1: GOSUB 4230
1530 IF CLUB$<"2" THEN 1640
1540 IF CLUB$>"9" THEN 1640
1550 IF CLUB$="2" THEN A=2
1560 IF CLUB$="3" THEN A=3
1570 IF CLUB$="4" THEN A=4
1580 IF CLUB$="5" THEN A=5
1590 IF CLUB$="6" THEN A=6
1600 IF CLUB$="7" THEN A=7
1610 IF CLUB$="8" THEN A=8
1620 IF CLUB$="9" THEN A=9
1630 GOTO 1670
1640 PRINT "YOUR IRONS ARE NUMBERED 2 THRU 9, RETYPE..."
1650 CLUB$=""
1660 GOTO 1460
1670 SEL=RND:IF SEL>.95 THEN GOTO 2650
1680 IF SOUNDSET$="ON" THEN SHELL "PLANY GOLF.WAV"
1690 IF K=0 THEN 1720
1700 IF INT(5*RND)=3 THEN 2690 'TO ON GREEN
1710 GOTO 2610 'TO MISSED THE BALL
1720 M=INT(35*RND+200)
1730 X=INT(M-14.4*A-(7*RND+38))
1740 Y=Y-INT(X)
1750 IF M/27=INT(M/27) THEN 2530 'TO WOODS
1760 IF M/8=INT(M/8) THEN 2420 'TO SAND TRAP
1770 IF M/32=INT(M/32) THEN 2610 'TO MISSED THE BALL
1780 IF M/69=INT(M/69) THEN 3400 'TO SINK SHOT
1790 GOTO 2250 'TO LENGTH OF SHOT
1800 PRINT "WHAT NUMBER WOOD"
1810 CLUB$=INKEY$:IF CLUB$="" THEN 1810
1820 IF CLUB$="E" OR CLUB$="e" OR CLUB$=CHR$(ESCAPE) THEN GOSUB 3990
1830 IF CLUB$="E" OR CLUB$="e" OR CLUB$=CHR$(ESCAPE) THEN GOTO 1190
1840 IF CLUB$="S" OR CLUB$="s" THEN GOSUB 4250
1850 IF CLUB$="S" OR CLUB$="s" THEN GOTO 1800
1860 TT=1: GOSUB 4230
1870 IF CLUB$<"1" THEN 1940
1880 IF CLUB$>"4" THEN 1940
1890 IF CLUB$="1" THEN A=1
1900 IF CLUB$="2" THEN A=2
1910 IF CLUB$="3" THEN A=3
1920 IF CLUB$="4" THEN A=4
1930 GOTO 1970
1940 PRINT "YOUR WOODS ARE NUMBERED 1-4, RETYPE..."
1950 CLUB$=""
1960 GOTO 1800
1970 SEL=RND:IF SEL>.95 THEN GOTO 2650 'to missed the ball
1980 IF SOUNDSET$="ON" THEN SHELL "PLANY GOLF.WAV"
1990 SEL=RND: IF SEL>.95 THEN GOSUB 4440 'to sink shot
2000 IF K=0 THEN 2030
2010 IF INT(7*RND)=3 THEN 2690 'TO ON GREEN
2020 GOTO 2610 'TO MISSED THE BALL
2030 X=INT(RND*250)
2040 IF A<>1 THEN 2070
2050 IF X<220 THEN 2030
2060 GOTO 2170
2070 IF A<>2 THEN 2110
2080 IF X<210 THEN 2030
2090 IF X>230 THEN 2030
2100 GOTO 2170
2110 IF A<>3 THEN 2150
2120 IF X<200 THEN 2030
2130 IF X>220 THEN 2030
2140 GOTO 2170
2150 IF X<190 THEN 2030
2160 IF X>210 THEN 2030
2170 Y=Y-X
2180 FOR I=1 TO (4-A+C^2)
2190 V=INT(30*RND)
2200 IF X/11=INT(X/11) THEN 2330
2210 IF X/5=INT(X/5) THEN 2480
2220 IF X/28=INT(X/28) THEN 2360
2230 IF X/27=INT(X/27) THEN 2530 'TO WOODS
2240 NEXT I
2250 IF Y>27 THEN 2310 'TO LENGTH OF SHOT
2260 IF Y<-23 THEN 2580 'TO OVERSHOT GREEN
2270 IF ABS(Y)<5 THEN 2450 'TO SINK SHOT
2280 IF (3.3*RND)=2 THEN 2410 'TO SAND TRAP
2290 IF (3.3*RND)=3 THEN 2610 'TO MISSED THE BALL
2300 GOTO 2690 'TO ON GREEN
2310 PRINT "YOU HIT IT";INT(X);"YARDS. YOU ARE";INT(Y);"YARDS AWAY."
2320 GOTO 1150
2330 IF Y<25 THEN 2420 'TO SAND TRAP
2340 PRINT "YOU ARE IN THE LEFT ROUGH";INT(Y);"YARDS AWAY."
2350 GOTO 1150
2360 IF