Skip to content

Commit

Permalink
feat: sort score from low to high
Browse files Browse the repository at this point in the history
  • Loading branch information
BoYanZh committed Oct 1, 2024
1 parent bc6d858 commit bc92b22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions joint_teapot/utils/joj3.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ def generate_scoreboard(
columns.index("last_edit")
] = now # FIXME: Delete this in formal version

# Sort data by total
data.sort(key=lambda x: int(x[columns.index("total")]), reverse=True)
# Sort data by total, from low to high
data.sort(key=lambda x: int(x[columns.index("total")]))

# Write back to the csv file:
with open(scoreboard_file_path, mode="w", newline="") as file:
Expand Down

0 comments on commit bc92b22

Please sign in to comment.