Linted everything, removed semistandard

This commit is contained in:
Angelos Chalaris
2018-10-18 23:38:01 +03:00
parent 1eb609cd90
commit 1fb3e65cca
27 changed files with 55 additions and 194 deletions

View File

@ -15,9 +15,9 @@ const elo = ([...ratings], kFactor = 32, selfRating) => {
const expectedScore = (self, opponent) => 1 / (1 + 10 ** ((opponent - self) / 400));
const newRating = (rating, i) =>
(selfRating || rating) + kFactor * (i - expectedScore(i ? a : b, i ? b : a));
if (ratings.length === 2) {
if (ratings.length === 2)
return [newRating(a, 1), newRating(b, 0)];
}
for (let i = 0, len = ratings.length; i < len; i++) {
let j = i;
while (j < len - 1) {