fix: use fixed point scale for tour scoring
1st=10, 2nd=8, 3rd=6, 4th=4, 5th=3, 6th=2, 7th=1, rest=0. Ties get same points, next rank skips (1,1,3 pattern).
This commit is contained in:
@@ -39,7 +39,7 @@ async function calculateLeaderboard(tourId) {
|
||||
};
|
||||
}
|
||||
|
||||
const numPlayers = players.length;
|
||||
const pointsByRank = [10, 8, 6, 4, 3, 2, 1];
|
||||
|
||||
for (const course of courses) {
|
||||
const courseResults = resultsByCourse[course.tour_course_id] || [];
|
||||
@@ -51,7 +51,7 @@ async function calculateLeaderboard(tourId) {
|
||||
rank = i + 1;
|
||||
}
|
||||
|
||||
const points = Math.max(numPlayers - rank + 1, 1);
|
||||
const points = rank <= pointsByRank.length ? pointsByRank[rank - 1] : 0;
|
||||
const r = courseResults[i];
|
||||
const relativePar = r.total_strokes - course.par;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user