Skip to content

Commit

Permalink
magnitude to 16
Browse files Browse the repository at this point in the history
  • Loading branch information
phattd15 committed Nov 17, 2021
1 parent 4804b7c commit 0309149
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions base/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,20 +321,20 @@ def validate_challenge(profile):
return False


def rating_gain(user_rating, problem_rating, magnitude=10):
def rating_gain(user_rating, problem_rating, magnitude=16):
if user_rating - problem_rating > 600:
return 2
elif user_rating - problem_rating > 1000:
return 1

chance = 1 / (1.15 + 10 ** ((problem_rating - user_rating) / 500))
return min(magnitude * 10, int(math.floor(magnitude * (0.5 / chance))))
return min(magnitude * 8, int(math.floor(magnitude * (0.5 / chance))))


def rating_loss(user_rating, problem_rating, magnitude=10):
def rating_loss(user_rating, problem_rating, magnitude=16):
chance = 1 / (1 + 10 ** ((problem_rating - user_rating) / 500))
chance = 1 - chance
return max(-int(math.floor(magnitude * (0.5 / chance))), magnitude * -10)
return max(-int(math.floor(magnitude * (0.5 / chance))), magnitude * -8)


def color_rating_2(rating):
Expand Down

0 comments on commit 0309149

Please sign in to comment.