Skip to content

filippetrovic/score-keeper-tell-dont-ask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Score Keeper Kata

Score Keeper Kata in Java with "Tell! Don't ask!" constraint. More about Score Keeper Kata and "Tell! Don't ask!" principle.

Problem

We need software to deliver the proper data to the scoreboard for a basketball team. Unfortunately the people using our software are not the brightest lights under the sun, so they need six buttons (each team can score either 1, 2 or 3 points with a single shot).

Your task

Write a class ScoreKeeper which offers following methods:

void scoreTeamA1()
void scoreTeamA2()
void scoreTeamA3()
void scoreTeamB1()
void scoreTeamB2()
void scoreTeamB3()

After every score change scoreboard should be immediately updated. Score board is represented with interface Scoreboard which has a method for displaying score:

interface Scoreboard {
  void display(String score);
}

Rules

Score, shown on scoreboard, should always has seven characters. An example would be 000:000

Releases

No releases published

Packages

No packages published

Languages