Skip to content

Instantly share code, notes, and snippets.

@mattmazzola
Created November 9, 2020 08:15
Show Gist options
  • Save mattmazzola/041965a704a59681b4acb64262aff2b4 to your computer and use it in GitHub Desktop.
Save mattmazzola/041965a704a59681b4acb64262aff2b4 to your computer and use it in GitHub Desktop.
Create Rating System
export function createRatingSystem(kFactor = 32, exponentDenominator = 400, exponentBase = 10): RatingSystem {
// Standard Elo implementation with symmetric kfactor functions for each player
// This would be a true zero-sum game where A(-x) = B(+x)
const getPlayerProbabilities = createPlayerProbabilitiesFn(exponentBase, exponentDenominator)
const getNextRating = createNextRatingFn(kFactor)
return {
getPlayerProbabilities,
getNextRating
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment