Last active
May 23, 2021 13:59
-
-
Save tschloss/ac6fd9bb60e9dc18e318ef6df1fe2a35 to your computer and use it in GitHub Desktop.
Golf World Handicap System > print table handicap-index:playing-handicap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Purpose: | |
# Golf > print table handicap-index:playing-handicap | |
# range of indexes: 0..36.0 | |
# handicaps should be negative, the display is *(-1) | |
# Author: Thomas Schlosser, [email protected] | |
cr = 72.5 | |
slope = 130 | |
par = 72 | |
def stvg2spvg (stvg, par, cr, slope): | |
return (round(stvg*slope/113 + cr - par)) | |
init = True | |
for stvg10 in range(361): | |
stvg = stvg10 /10 | |
spvg = stvg2spvg(stvg, par, cr, slope) | |
if init: | |
init = False | |
stvg_lag = stvg | |
spvg_lag = spvg | |
stvg_intervall_start = stvg | |
#print(stvg) | |
if (spvg != spvg_lag): | |
print (stvg_intervall_start,' - ',stvg_lag,' : ', spvg_lag) | |
stvg_intervall_start = stvg | |
# print (stvg) | |
spvg_lag = spvg | |
stvg_lag = stvg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment