Commit 3cb30215 by ziho

simple elo rating system

parent 95fa4b2c
...@@ -158,10 +158,10 @@ class EloRatingSystem: ...@@ -158,10 +158,10 @@ class EloRatingSystem:
k=choose_k(R2) k=choose_k(R2)
player2.rating=R2+k*(1-winrate-E2) player2.rating=R2+k*(1-winrate-E2)
# if player1.rating<0: if player1.rating<0:
# player1.rating=0 player1.rating=0
# elif player2.rating<0: elif player2.rating<0:
# player2.rating=0 player2.rating=0
if online: if online:
#print('{}\'s rating:{}->{} ; {}\'s rating:{}->{}'.format(p1,R1,player1.rating,p2,R2,player2.rating)) #print('{}\'s rating:{}->{} ; {}\'s rating:{}->{}'.format(p1,R1,player1.rating,p2,R2,player2.rating))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment