Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swiss api results - score field #99

Closed
eduherminio opened this issue Apr 15, 2021 · 1 comment
Closed

Swiss api results - score field #99

eduherminio opened this issue Apr 15, 2021 · 1 comment

Comments

@eduherminio
Copy link
Contributor

What does the score field in the current swiss api results endpoint mean, and/or how can it be mapped to the number of actual points? Can this be a bug?

Example

Tournament:
https://lichess.org/swiss/fe4Fzg8R

API endpoint:
https://lichess.org/api/swiss/fe4Fzg8R/results

ndjson:

{"rank":0,"score":60227444,"tieBreak":22.5,"rating":2304,"username":"bulletbaz","performance":2444}
{"rank":1,"score":60172286,"tieBreak":17,"rating":2092,"username":"destran","performance":2286}
{"rank":2,"score":50157170,"tieBreak":15.5,"rating":2226,"username":"Shuyebahmed123","performance":2170}
...
@eduherminio
Copy link
Contributor Author

score comes from:

SwissPlayer.recomputeScore

  def recomputeScore =
    copy(
      score = Swiss.makeScore(points, tieBreak, performance | Swiss.Performance(rating.toFloat))
    )

which uses:

Swiss.Settings.MakeScore

  def makeScore(points: Points, tieBreak: TieBreak, perf: Performance) =
    Score(
      (points.value * 10000000 + tieBreak.value * 10000 + perf.value).toInt
    )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant