ivarcode / schackmatt

chess website
http://www.schackmatt.net/
8 stars 5 forks source link

adding the elo calculator #146

Closed cristian-5 closed 3 years ago

cristian-5 commented 3 years ago

Elo calculator, as FIDE intended. Tested against the real FIDE calculator https://ratings.fide.com/calculator_rtd.phtml. K factor set to 40 for new players, 20 after 30 games and 10 after 2400. It stays at 10 even if a player drops below 2400 (as specified by FIDE). Rating starts at 1500 (as specified by FIDE). There's a floor of 100 that prevents inflation and a ceiling of 3000 that prevents deflation, however FIDE does not take into account players with a rating less than 1000 so their floor is set to 1000 (but that does not change the formula). There's a new error correction system in the expected value, since if a GM has a very bad day and loses against someone with a very low rating, they don't get punished too much. In fact the same applies to lower rated players who lose to GMs and prevents their rating from dropping at all. The threshold that makes the correction system kick in is |A - B| > 400 where A and B are the ratings of the two players (as FIDE specifies). This system is currently in use by different countries, since it's easy to calculate by hand.

ivarcode commented 3 years ago

See https://github.com/ivarcode/schackmatt/pull/148 and README for branch naming convention :)

Tested, works for me. Good stuff!