mirror of
https://github.com/TheRealOwenRees/echecsfrance.git
synced 2026-07-23 04:26:57 +00:00
Fix ratings calculator
This commit is contained in:
@@ -70,6 +70,7 @@ export const TournamentResults = ({
|
|||||||
game.result as 1 | 0 | 0.5,
|
game.result as 1 | 0 | 0.5,
|
||||||
kFactor,
|
kFactor,
|
||||||
);
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
rating: acc.rating + delta,
|
rating: acc.rating + delta,
|
||||||
deltas: [
|
deltas: [
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ export const getNewRating = (
|
|||||||
result: 1 | 0 | 0.5,
|
result: 1 | 0 | 0.5,
|
||||||
kFactor: number,
|
kFactor: number,
|
||||||
) => {
|
) => {
|
||||||
const differenceInElo = clamp(opponentRating - rating, -400, 400);
|
const differenceInElo = clamp(opponentRating - rating, -400, Infinity);
|
||||||
const tableRow = (differenceToProbability.find(
|
const tableRow = (differenceToProbability.find(
|
||||||
([start, end]) =>
|
([start, end]) =>
|
||||||
Math.abs(differenceInElo) >= start && Math.abs(differenceInElo) <= end,
|
Math.abs(differenceInElo) >= start && Math.abs(differenceInElo) <= end,
|
||||||
|
|||||||
Reference in New Issue
Block a user