Skip to content

Instantly share code, notes, and snippets.

@paul-english
Created September 8, 2016 14:22
Show Gist options
  • Save paul-english/dcd5d9307dd90b3e27b4fe469b10c32b to your computer and use it in GitHub Desktop.
Save paul-english/dcd5d9307dd90b3e27b4fe469b10c32b to your computer and use it in GitHub Desktop.
def offensive_score(player):
score = 0
score += player['passing_yds']*0.04
score += player['passing_tds']*4
score += player['passing_int']*-1
score += player['rushing_yds']*0.1
score += player['rushing_tds']*6
score += player['receiving_rec']*0.5
score += player['receiving_yds']*0.1
score += player['receiving_tds']*6
score += player['kicking_rec_tds']*6
score += player['puntret_tds']*6
score += player['fumbles_rec_tds']*6
score += player['fumbles_lost']*-2
score += player['receiving_twoptm']*2 # TODO
return score
def pts_allowed(x):
if x == 0: return 10
elif x <= 6: return 7
elif x <= 13: return 4
elif x <= 20: return 1
elif x <= 27: return 0
elif x <= 34: return -1
else: return -4
def defensive_score(team):
score = 0
score += team['defense_sks']*1
score += team['defense_safe']*2
score += team['defense_int']*2 # TODO
score += team['fumbles_rec']*2 # TODO
score += team['defense_fgblk']*2
score += team['defense_tds']*6
score += team['kicking_ret_tds']*6 # TODO
score += team['defense_misc_tds']*2 # TODO do we even have this
score += pts_allowed(team['pts_allowed']) # TODO need to gather from game level
return score
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment