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

Rating formula [question] #25

Closed
bl4de opened this issue Sep 9, 2015 · 2 comments
Closed

Rating formula [question] #25

bl4de opened this issue Sep 9, 2015 · 2 comments

Comments

@bl4de
Copy link

bl4de commented Sep 9, 2015

Hi,

First of all - thanks guys for CTFtime.org, it's great idea to aggregate all CTF-related things in one place. Taking a part in CTFs is one of the best way to learn new things.

I've got a question about rating formula. I've created simple Python script to calculate points taken in CTF for CTFtime overall ranking. However, results returned from this script are quite different from points showed on CTFtime page.

This is my script:

#!/usr/bin/python
#
# CTF event points -> CTFtime.org ranking points calculator
# Rating formula see: https://ctftime.org/rating-formula/
#
#
# Calculates team's points from CTF for CTFtime.org overall ranking
#


def calculate():
    rating = 0.0

    points_coef = float(team_points) / best_points
    place_coef = float(1) / team_place

    if points_coef > 0:
        rating = ((points_coef + place_coef) * weight) / (1 + float(team_place)/total_teams)

    return rating

if __name__ == '__main__':

    team_place = int(raw_input("your team place in CTF: "))
    team_points = int(raw_input("earned CTF points: "))
    total_teams = int(raw_input("teams with any points (more than 0) in CTF: "))
    best_points = int(raw_input("winner team points: "))
    weight = int(raw_input("CTF event rating weight (by CTFtime.org): "))

    print "\n### Your team earned {0:.4f} points in this CTF, congrats! ###"\
        .format(calculate())

And this is sample output (calculated rating points from Boston Key Party 2015 - https://ctftime.org/event/163 - yeah, I know, my points are totally hopeless, but I'm a total beginner and I'm playing alone... ):

your team place in CTF: 285
earned CTF points: 170
teams with any points (more than 0) in CTF: 822
winner team points: 6445
CTF event rating weight (by CTFtime.org): 60

### Your team earned 1.3315 points in this CTF, congrats! ###

On my team page there are 1,793 added points after Boston Key Party 2015.

How can I apply total_team_ranking in my script? Is this causing this difference? I'd be grateful for help.

If this issue is not appropriate here, please close/remove it :) I just didn't know where and who could I ask for this. Thank you.

@kyprizel
Copy link
Contributor

kyprizel commented Mar 1, 2016

Sorry, the formula on the picture is incorrect - correct denominator is 1/(1+(team_place/total_teams)).

@kyprizel kyprizel closed this as completed Mar 1, 2016
bl4de added a commit to bl4de/ctf that referenced this issue Mar 2, 2016
Fix rating formula (see ctftime/ctftime.org#25 (comment) for details)
@bl4de
Copy link
Author

bl4de commented Mar 2, 2016

Now it's working perfect, thanks!

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

2 participants