Bonus Assignment - Tennis Game Kata PV260 Software Quality May 4, 2015 Tennis Game - Scoring Each player starts with 0 points The scoring then goes like this 0 → 15 → 30 → 40 If A has 40 and scores, and B doesn’t have 40, A wins If both have 40 and A scores, A has Advantage If A has Advantage and scores, they win If A has Advantage, B has 40 and scores, both are at 40 again Scores are written in the format ’A - B’, e.g. ’30 - 15’ When A has Advantage, the score is written as ’A - 40’ If scores are equal, e.g. both have 30, it is called ’30 all’ If both players have 40 points, it is called ’deuce’ Tennis Game - Controls Specification The game is controlled from console User enters text commands, for each command there must be some response description of new state unknown command notification list of available commands . . . Commands are NOT case sensitive The state descriptions can be wrapped in arbitrary text to decorate the output. E.g. if the score is 15 30 the output can be ’Current score is 15 - 30.’ or ’The score is 15 - 30 now’ etc. Tennis Game - Controls Specification Following commands exist: ’Exit’ : Quits the program ’New Game’ : Can be called at any time, scoring is reset to 0 ’Player X Scored’ : Where ’X’ is either A or B, increments score of player X ’Show Score’ : Displays text containing the score which is in the format specified above. If there is a winner already, output is same as that of ’Show Winner’ ’Show Winner’ : Displays name of the winner (’A’ or ’B’) or text containing ’no one’ if there is no winner yet