saadismail / Tennis-Refactoring-Kata

Starting code for a Refactoring Code Kata on the Tennis rules

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Taken from: emilybache/Tennis-Refactoring-Kata

Tennis Refactoring Kata

Tennis has a rather quirky scoring system, and to newcomers it can be a little difficult to keep track of. The tennis society has contracted you to build a scoreboard to display the current score during tennis games.

You can read more about Tennis scores on wikipedia which is summarized below:

  • A game is won by the first player to have won at least four points in total and at least two points more than the opponent.
  • The running score of each game is described in a manner peculiar to tennis: scores from zero to three points are described as "Love", "Fifteen", "Thirty", and "Forty" respectively.
  • If at least three points have been scored by each player, and the scores are equal, the score is "Deuce".
  • If at least three points have been scored by each side and a player has one more point than his opponent, the score of the game is "Advantage" for the player in the lead.
  • You need only report the score for the current game. Sets and Matches are out of scope.

The test suite provided is fairly comprehensive, and fast to run. You should not need to change the tests, only run them often as you refactor.

Setup

yarn install

And then to run the tests: yarn test

About

Starting code for a Refactoring Code Kata on the Tennis rules

License:MIT License


Languages

Language:TypeScript 97.6%Language:JavaScript 2.4%