Skip to content

Instantly share code, notes, and snippets.

View SreedevSB's full-sized avatar

Sreedev S B SreedevSB

  • Trivandrum, Kerala
View GitHub Profile
@SreedevSB
SreedevSB / calculate_new_elorating
Created January 17, 2021 11:53
Python function to calculate changed elo rating after a chess match
def calc_new_elo(a,b,winner, k=20):
# a = rating of a
# b = rating of b
# if a wins then winner = 1
# if b wins then winner = 2
# if draw then winner = 0.5
# k factor default value is 20