{"id":25201841,"url":"https://github.com/rkwap/rating-system","last_synced_at":"2026-02-18T03:36:06.043Z","repository":{"id":244699490,"uuid":"815993207","full_name":"rkwap/rating-system","owner":"rkwap","description":"A method for calculating the relative skill levels of players in multiplayer games and tournaments, inspired by the rating system used by Codeforces.","archived":false,"fork":false,"pushed_at":"2024-06-16T19:22:14.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-04T18:54:05.595Z","etag":null,"topics":["codeforces","elo","rating-system"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/rating-system","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rkwap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-16T18:54:01.000Z","updated_at":"2024-06-16T19:25:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"cef2599e-2854-4202-9802-e6561350f01c","html_url":"https://github.com/rkwap/rating-system","commit_stats":null,"previous_names":["rkwap/rating-system"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rkwap/rating-system","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkwap%2Frating-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkwap%2Frating-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkwap%2Frating-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkwap%2Frating-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rkwap","download_url":"https://codeload.github.com/rkwap/rating-system/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkwap%2Frating-system/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29567577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T00:47:08.760Z","status":"online","status_checked_at":"2026-02-18T02:00:09.468Z","response_time":162,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codeforces","elo","rating-system"],"created_at":"2025-02-10T05:42:05.207Z","updated_at":"2026-02-18T03:36:01.021Z","avatar_url":"https://github.com/rkwap.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rating System\nA simple implementation of a modified Elo-based Rating System for Multiplayer Games and tournaments, which is currently used by Codeforces. This implementation is based on: [MikeMirzayanov's Submission](https://codeforces.com/contest/1/submission/13861109).\n\n## Features\n\n- Calculates new ratings for players based on their performance in a tournament.\n- Modified Elo rating system adapted for multiplayer games.\n\n# Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'rating_system'\n```\n\nAnd then execute:\n\n```bash\n$ bundle\n```\n\nOr install it yourself as:\n\n```bash\n$ gem install rating_system\n```\n\n## Usage\n\nIn a tournament, player A, with a rating of `1500`, plays against opponents with the following ratings: `1500`, `1658`, `1256`, `1353`.\n\nLet's assume the rankings of players after the tournament ends are:\n\n- A -\u003e 1\n- B -\u003e 2\n- C -\u003e 3\n- D -\u003e 4\n- E -\u003e 5\n\nSo, to calculate the new ratings based on the lastest ranks, we would use this gem like this:\n\n```ruby\ncontestants = [\n  {\n    position: 1,\n    user_id: 'A',\n    previous_rating: 1500\n  },\n  {\n    position: 2,\n    user_id: 'B',\n    previous_rating: 1500\n  },\n  {\n    position: 3,\n    user_id: 'C',\n    previous_rating: 1658\n  },\n  {\n    position: 4,\n    user_id: 'D',\n    previous_rating: 1256\n  },\n  {\n    position: 5,\n    user_id: 'E',\n    previous_rating: 1353\n  }\n]\n\nRatingSystem::RatingCalculator.get_new_ratings(contestants) # Gets new ratings array\n\nOUTPUT:\n\n[\n  {:position=\u003e1, :user_id=\u003e\"A\", :previous_rating=\u003e1500, :delta=\u003e125, :new_rating=\u003e1625},\n  {:position=\u003e2, :user_id=\u003e\"B\", :previous_rating=\u003e1500, :delta=\u003e31, :new_rating=\u003e1531},\n  {:position=\u003e3, :user_id=\u003e\"C\", :previous_rating=\u003e1658, :delta=\u003e-72, :new_rating=\u003e1586},\n  {:position=\u003e4, :user_id=\u003e\"D\", :previous_rating=\u003e1256, :delta=\u003e0, :new_rating=\u003e1256},\n  {:position=\u003e5, :user_id=\u003e\"E\", :previous_rating=\u003e1353, :delta=\u003e-93, :new_rating=\u003e1260}\n]\n```\n\n## Benchmarks\n\nBenchmarks for the rating system are coming soon. Stay tuned for performance metrics and comparisons!\n\n\n## License\n\nThe code is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkwap%2Frating-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frkwap%2Frating-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkwap%2Frating-system/lists"}