filippetrovic / score-keeper-tell-dont-ask

Score Keeper kata in Java with "Tell! Don't ask!" constraint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Score Keeper kata in Java with "Tell! Don't ask!" constraint

License:GNU General Public License v3.0


Languages

Language:Java 100.0%