The Python code is fully self contained. Includes all data like actual scores and course information. Scores have to be typed in into a Python variable with the correct syntax.
Scores are maintained in two structures:
- "per hole": scores are grouped per hole (blank between holes). Good for recording scores of own flight.
- "per player": scores are grouped per player. Good for mass input after the round.
The handicap can either be maintained in a lookup variable (use '?' to use the lookup) or in the scores datastructure directly. Writing the handicap as a decimal number causes calculation of playing handicap, writing it as integer used this number without calculation.
Two competitions are evaluated (always 9 holes):
- Stableford net points (worst player pays best player a drink)
- Matchplay each player against every other player (net; looser pays 5€ to winner)
Matchplay: (player1 - player2) * 3 / 4 ==> rounding ==> / 2 for holes => if number was odd, a half stroke is used Stableford: odd handicap ==> add a stroke for second nine holes