npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ttr-calculator-typescript

v1.0.13

Published

A calculator for the table tennis rating written in TypeScript.

Downloads

86

Readme

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