Skip to content

Commit b7d1226

Browse files
unhappychoiceclaude
andcommitted
fix: correct ranking position calculation to show higher scores first
Previously, higher scores were displayed with larger position numbers (e.g., position 63/63 for highest score). Fixed the position calculation in both tier and overall rankings by reversing the position calculation to show higher scores with smaller position numbers (1st, 2nd, etc.). closes: #187 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b1c35d1 commit b7d1226

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/scoring/rank_calculator.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ impl RankCalculator {
2424
}
2525
.to_string();
2626

27-
let tier_position = same_tier_ranks
28-
.iter()
29-
.position(|rank| rank.name() == current_rank.name())
30-
.unwrap_or(0)
31-
+ 1;
27+
let tier_position = same_tier_ranks.len()
28+
- same_tier_ranks
29+
.iter()
30+
.position(|rank| rank.name() == current_rank.name())
31+
.unwrap_or(0);
3232

3333
let tier_total = same_tier_ranks.len();
3434

35-
let overall_position = all_ranks
36-
.iter()
37-
.position(|rank| rank.name() == current_rank.name())
38-
.unwrap_or(0)
39-
+ 1;
35+
let overall_position = all_ranks.len()
36+
- all_ranks
37+
.iter()
38+
.position(|rank| rank.name() == current_rank.name())
39+
.unwrap_or(0);
4040

4141
let overall_total = all_ranks.len();
4242

0 commit comments

Comments
 (0)