Architecture Kata “Categories Game”
Write a software to play the Categories game with several players.
The “game board” is a table like this:
It has several columns for categories. Rows represent game rounds.
During each round the players try to find entries for the categories beginning with a certain letter of the alphabet. The letter is determined by chance and should not occur more than once per game.
The number of rounds per game is limited (e.g. 10) and can be agreed upon before the game starts.
A round ends once a player has found entries for all categories and decides to “call Stop!” – or after a agreed upon timeout.
The score for a round is calculated very simply calculated as the sum of points for each category’s entry:
- Solo: If a player is the only one with an entry for a category she receives 20 points for that entry
- Unique: If a player’s entry for a category is unique among the players he receives 10 points for it
- Duplicate: If a player’s entry is non-unique she receives 5 points for it
- None: Without an entry the player receives 0 points for the category
The total score of a player is the sum of the round scores.
The winner is the player with the highest total score.
The program should make it easy for several people sitting together to play the game.
Any player can start a game and will be presented with a unique game id. This game id can be used by the other players to join the game. Alternatively the initiator can enter email addresses of players to invite via email.
Before the game id is issued the game has to be set up:
- What should the categories be? Default: City, Country, River, Name, Animal, Profession
- Should there be a timeout? Default: No
- How many rounds to play?
Once all players have joined the game the initiator can start the first round. The program will present the letter to find category entries for.
Player’s can stop the round or a round times out automatically.
Scoring unfortunately cannot be done automatically because entries might not be correct contentwise. The players have to agree on correctness and uniqueness and score their entries themselves as Solo, Unique etc. Some honesty required ;-)
The sum of the category points per round and the total score, though, are calculated automatically.
After scoring has been completed the next round can be started.
The game ends after the pre-set number of rounds – or can be finished at any time manually.
To score a round the entries of all players are presented to all players for review. Each player then silently marks the entries as Solo, Unique, Duplicate or Invalid. The review results then are merged by the program to calculate the scores.
If a conflict arises (ie. entries are marked differently by the players) then those entries are presented to the game’s initiator for resolution.