ttr-calculator-typescript
TypeScript icon, indicating that this package has built-in type declarations

1.0.12 • Public • Published

Build

🏓 TTR Calculator

A calculator for the table tennis rating.

🔎 Input

The function calculateTTRatingMultipeOpponents(ttPlayer: TTPlayer, playedGames: TTGame[]) expects as input information about the player for whom the rating shall be calculated, and information about the game(s) that the player played in one event.

The TTPlayer must contain (some of) the following information:

  • ttRating: number: The rating of the player before having played the games.
  • isYoungerThan21: boolean (optional): Set to true if the player is younger than 21.
  • isYoungerThan16: boolean (optional): Set to true if the player is younger than 16. In this case, isYoungerThan21 must also be set to true.
  • lessThan30SingleGames: boolean (optional): Set to true if the player has played less than 30 single games overall.
  • lessThan15SingleGamesOverallOrAfterYearBreak (optional): Set to true if the player had a break of at least one year and has played less than 15 single games since the break.

TTGame[] is an array of games that have been played during an event. For each game, the following information must be provided:

  • opponentTTRating: number: The rating of the opponent player before having played the game.
  • gameWasWon: boolean: Set to true if the game was won.

🧮 Calculation Result

The function calculateTTRatingMultipeOpponents(ttPlayer: TTPlayer, playedGames: TTGame[]) provides the following information as result of the calculation:

  • updatedRating: number: The updated rating of the player after the game(s).
  • expectedNumberWins: number: The number of expected wins for the game(s).
  • winExpectations: number[]: The winning expectation for each single TT game. The order of winning expectation is the same as the order of input TT games.
  • ratingChange: number: The change to the TTR value of the player.

🔗 Links

  • TTR calculator on GitHub
  • TTR calculator package on npm

Readme

Keywords

Package Sidebar

Install

npm i ttr-calculator-typescript

Weekly Downloads

1

Version

1.0.12

License

MIT

Unpacked Size

13.8 kB

Total Files

8

Last publish

Collaborators

  • luthium