Function skill_rating::elo::game [] [src]

pub fn game(r_a: EloRating, r_b: EloRating, s_a: f32, k_a: u32, k_b: u32) -> (EloRating, EloRating)

Calculates the updated elo ratings of both players after a match. The k_a and k_b are the K factors used to determine the updated rating, If you just want a default behaviou set these to 32, or use game_icc() instead.

Example

Updates the rankings of John and Paul, after Paul won over John.

use skill_rating::elo;
 
let john = 1700;
let paul = 1800;

let (john, paul) = elo::game(paul, john, elo::WIN, 32, 32);