Classic Computer Magazine Archive ANTIC VOL. 6, NO. 2 / JUNE 1987

Golf Handicap Calculator

You'll have more time to improve your stroke

BY JERRY WHITE

Calculate golf handicaps in a fraction of the time it would take to do on paper. This BASIC program works on all 8-bit Atari computers of any memory size, with disk drive.

If you're a serious golfer, you've probably driven yourself crazy more than once trying to determine your handicap. Perhaps you'd sit down with paper and pencil to write, cross out, tear, write some more, tear some more, crumple the paper and finally give up.

Calculating and maintaining a current handicap by hand is a five-step process. First, take your most recent scores-up to 20 of them-and corresponding course ratings. Second, subtract the course rating from each score-that is, determine how much each score was over par. (Most 18-hole courses are par 72.) Third, multiply the result by .95 to obtain your handicap for each round. Fourth, select the best half of your round handicap. And finally, calculate the average of those scores to obtain your current handicap.

You can see how this process can be both tedious and time-consuming-a waste of hours when you might otherwise be playing golf. Therefore, why not try the Golf Handicap Calculator? You can update your scores and see your current handicap in a matter of seconds. The program stores the necessary information on disk and performs all the calculations

TYPING & USING
Type in Listing 1, GOLFHDCP.BAS, check it with TYPO II and SAVE a copy before you RUN it. The program first looks for a data file on disk drive 1 called GOLFHDCP.DAT. A menu appears with three options-Enter Scores, Display Scores, or Save Scores and Exit. Select your menu choice and press [RETURN]. You must always press [RETURN] after entering data or making choices in Golf Handicap Calculator.

When you use option 1 to enter scores, you should enter the date of that round in the "YYMMDD" format, which makes it easier for the computer to sort by date. For example, November 1, 1986 would be entered as 861101. Then enter your score and the course rating. Some courses have unusual ratings, such as 71.5. This program allows one decimal place for such an occasion.

Then you will be given a yes/no prompt asking if the data you've entered is correct. Think before you answer, and check that information carefully. This is your only chance to make corrections within the program.

Only 18-hole scores can be used, so if you play at a nine-hole course wait until you have played twice. Then enter rounds by adding your two nine-hole scores together.

With option 2, you can have a display of up to 20 of your most recent entries in descending chronological order, followed by your current handicap.

Exiting this program using option 3 saves on disk whatever new scores you have entered, and then it returns control to BASIC.

PROGRAM STORAGE
Your data is stored on disk in 20-character fixed-length records. You can use a word processor to make corrections to the disk data file as long as you maintain the 20-character record length.

Each record contains four items (fields) which are, respectively, the date, the score, the course rating and the handicap calculated by the program. If you make changes, be sure to keep each item in its proper position. If you change a score or course rating, you'll also have to change the appropriate handicap for that record.

Once you have a data file on disk, it will automatically be used as input when the program is RUN. The program and data file must reside on the same disk. To keep a handicap for more than one person, you'll need a separate disk for each.

Jerry White is a well-known professional Atari programmer who has contributed many articles to Antic over the years.

IF YOU'D ENJOY SEEING MORE ARTICLES LIKE THIS ONE, CIRCLE 206 ON THE READER SERVICE CARD.

Listing 1   GOLFHDCP.BAS Download