11# Instructions
22
3- The dice game [ Yacht] [ yacht ] is from the same family as Poker Dice, Generala and particularly Yahtzee, of which it is a precursor.
4- In the game, five dice are rolled and the result can be entered in any of twelve categories.
5- The score of a throw of the dice depends on category chosen.
3+ Given five dice and a category, calculate the score of the dice for that category.
4+
5+ ~~~~ exercism/note
6+ You'll always be presented with five dice.
7+ Each dice's value will be between one and six inclusively.
8+ The dice may be unordered.
9+ ~~~~
610
711## Scores in Yacht
812
@@ -21,15 +25,6 @@ The score of a throw of the dice depends on category chosen.
2125| Choice | Sum of the dice | Any combination | 2 3 3 4 6 scores 18 |
2226| Yacht | 50 points | All five dice showing the same face | 4 4 4 4 4 scores 50 |
2327
24- If the dice do not satisfy the requirements of a category, the score is zero.
28+ If the dice do ** not** satisfy the requirements of a category, the score is zero.
2529If, for example, _ Four Of A Kind_ is entered in the _ Yacht_ category, zero points are scored.
2630A _ Yacht_ scores zero if entered in the _ Full House_ category.
27-
28- ## Task
29-
30- Given a list of values for five dice and a category, your solution should return the score of the dice for that category.
31- If the dice do not satisfy the requirements of the category your solution should return 0.
32- You can assume that five values will always be presented, and the value of each will be between one and six inclusively.
33- You should not assume that the dice are ordered.
34-
35- [ yacht ] : https://en.wikipedia.org/wiki/Yacht_(dice_game)
0 commit comments