Travis build: 659

This commit is contained in:
30secondsofcode
2018-10-19 06:06:32 +00:00
parent e5d9cfbf2b
commit a9d3d77be2
11 changed files with 213 additions and 452 deletions

View File

@ -15,8 +15,7 @@ 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)
return [newRating(a, 1), newRating(b, 0)];
if (ratings.length === 2) return [newRating(a, 1), newRating(b, 0)];
for (let i = 0, len = ratings.length; i < len; i++) {
let j = i;