Hello and welcome to this programming kata.
This kata consists of several parts where you should solve one part before you look at the next.
While you could speed through this kata by just implementing the requirements as quickly as possible, the intention of this kata is to practice Test Driven Development and as such you're recommended to think about this as production code and write proper tests for your implementation.
Where appropriate, an example will be shown to better explain the problem. These examples are perfect for an initial test case. I do recommend that you write more tests than just based on the example though, the aim, after all, is to drive development by passing tests.
Good luck!
/Raniz
Your task in this kata is to implement a dice game. The game will start out simple but will progressively become more complex. It will be an interactive application, but you are free to choose whichever language and interface type you want.
Implement a dice game with three dice. The game consists of 10 throws, a player's score is the sum of all dice values thrown.
The game now consist of 10 rounds. Each round consists of three throws where the player may choose to save one or more dice and only rethrow the other dice. The score for each round is the sum of the final dice values after three throws. The total score is the sum of all round scores.
After every game, print a list of all rounds and the final dice values.
The game now uses five dice instead of three.
Instead of just counting values we will now try to match specific targets. In each game, the player aims to complete a list of targets. Each target can only be completed once and if the dice cannot be combined in a way that satisfies a target, the player has to choose a target to cross out and gets zero points in that round.
The different targets are:
Implement Yatzy.
In addition to the previous targets the following targets are now available:
Instead of the log, print a Yatzy scorecard with dice values and score.
====================================
| Ones | 1 3 5 1 1 | 3 |
| Twos | 2 3 2 1 1 | 4 |
| Threes | 3 3 3 3 4 | 12 |
| Fours | 4 4 6 4 3 | 12 |
| Fives | 6 5 6 5 5 | 15 |
| Sixes | 6 3 2 6 6 | 18 |
| Total | 64 |
| Bonus | 50 |
====================================
| A Pair | 1 4 5 5 1 | 10 |
| Two Pairs | 2 6 6 1 2 | 16 |
| Three of a kind | 4 5 4 4 1 | 12 |
| Four of a kind | 1 1 1 6 1 | 4 |
| Small straight | 1 5 3 4 2 | 15 |
| Large straight | 6 2 3 4 5 | 20 |
| Full house | 1 1 5 5 3 | - |
| Chance | 2 3 6 5 5 | 21 |
| Yatzy | 3 3 5 3 3 | - |
====================================
| Total | - |
The player can now choose if they want to play regular Yatzy or Mega Yatzy.
Mega yatzy is played with 6 dice and 4 throws. In addition to the targets for regular yatzy, the following new targets become available:
Add support for multiple players.