Skip to content

Instantly share code, notes, and snippets.

@tschloss
Last active May 23, 2021 13:59
Show Gist options
  • Save tschloss/ac6fd9bb60e9dc18e318ef6df1fe2a35 to your computer and use it in GitHub Desktop.
Save tschloss/ac6fd9bb60e9dc18e318ef6df1fe2a35 to your computer and use it in GitHub Desktop.
Golf World Handicap System > print table handicap-index:playing-handicap
#!/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