@andreabiagini5/applicazioni-e-servizi-web-project - v1.1.3
    Preparing search index...

    Function getNewRating

    • updateRating This function calculates the new ratings for two players based on their current ratings and the result of the game. It uses the Elo rating system to calculate the new ratings.

      Parameters

      • ratingA: number

        The current rating of Player A.

      • ratingB: number

        The current rating of Player B.

      • result: GameResult

        The result of the game.

      • kFactor: number = DEFAULT_K_FACTOR

        The K-factor used in the Elo rating system. Default is 32.

      Returns [number, number]

      • The new ratings for Player A and Player B, rounded to 2 decimal places.