Coding Dojo

Edit on Gitlab

Yahtzee

About this Kata

This problem is based on Ruby Quiz #19 ( http://rubyquiz.com/quiz19.html ). The kata takes about 20 minutes with practice and 2 hours in a dojo setting.

Problem Description

The game of yahtzee is a simple dice game. Each round, each player rolls five six sided dice. The player may choose to reroll some or all of the dice up to three times (including the original roll). The player then places the roll at a category, such as ones, twos, sixes, pair, two pairs etc. If the roll is compatible with the score, the player gets a score for this roll according to the rules. If the roll is not compatible, the player gets a score of zero for this roll.

The kata consists of creating the rules to score a roll in any of a predefined category. Given a roll and a category, the final solution should output the score for this roll placed in this category.

Yahtzee rules description and suggested test cases

The following categories exists:

The practitioner can feel free to create new categories as well.