{"id":27147366,"url":"https://github.com/ocelotko/elo","last_synced_at":"2025-08-16T10:44:35.944Z","repository":{"id":286093784,"uuid":"959041722","full_name":"ocelotko/elo","owner":"ocelotko","description":"A simple and efficient Rust library for calculating Elo ratings. Provides functions for probability calculation and Elo rating updates.","archived":false,"fork":false,"pushed_at":"2025-04-04T09:26:04.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T10:29:10.543Z","etag":null,"topics":["algorithm","elo","lib","library","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/ocelotko.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":"2025-04-02T07:10:12.000Z","updated_at":"2025-04-04T09:26:47.000Z","dependencies_parsed_at":"2025-04-04T10:39:34.471Z","dependency_job_id":null,"html_url":"https://github.com/ocelotko/elo","commit_stats":null,"previous_names":["ocelotko/elo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ocelotko/elo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocelotko%2Felo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocelotko%2Felo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocelotko%2Felo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocelotko%2Felo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ocelotko","download_url":"https://codeload.github.com/ocelotko/elo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocelotko%2Felo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270702472,"owners_count":24630873,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"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":["algorithm","elo","lib","library","rust"],"created_at":"2025-04-08T11:25:53.984Z","updated_at":"2025-08-16T10:44:35.884Z","avatar_url":"https://github.com/ocelotko.png","language":"Rust","readme":"# Elo Algorithm in Rust\n\nThis library provides an implementation of the **Elo rating system** in Rust. It is a simple, efficient way to calculate the Elo ratings of two players based on the outcome of a match.\n\n## Usage\n\nHere’s a basic example showing how to use this library:\n\n```rust\nuse elo::{probability, elo_rating};\n\nfn main() {\n    let player_a_rating = 1500.0;\n    let player_b_rating = 1600.0;\n    let k_factor = 32; // Adjust K-factor as needed\n\n    // Calculate the probability of player A winning\n    let prob_a = probability(player_a_rating, player_b_rating);\n    println!(\"Probability of player A winning: {}\", prob_a);\n\n    // Simulate a game where player A wins (outcome = 1.0)\n    let outcome = 1.0;\n    let (new_a_rating, new_b_rating) = elo_rating(player_a_rating, player_b_rating, k_factor, outcome);\n\n    println!(\"New player A rating: {}\", new_a_rating);\n    println!(\"New player B rating: {}\", new_b_rating);\n\n    // Simulate a game where player B wins (outcome = 0.0)\n    let outcome_b = 0.0;\n    let (new_a_rating_b, new_b_rating_b) = elo_rating(player_a_rating, player_b_rating, k_factor, outcome_b);\n\n    println!(\"New player A rating when B wins: {}\", new_a_rating_b);\n    println!(\"New player B rating when B wins: {}\", new_b_rating_b);\n\n    // Simulate a draw (outcome = 0.5)\n    let outcome_draw = 0.5;\n    let (new_a_rating_draw, new_b_rating_draw) = elo_rating(player_a_rating, player_b_rating, k_factor, outcome_draw);\n\n    println!(\"New player A rating when Draw: {}\", new_a_rating_draw);\n    println!(\"New player B rating when Draw: {}\", new_b_rating_draw);\n}\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focelotko%2Felo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Focelotko%2Felo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focelotko%2Felo/lists"}