Skip to content

Commit

Permalink
yacht: split into instructions and introduction (#2430)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSchierboom committed Apr 26, 2024
1 parent 2d84e12 commit f7c0c39
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
23 changes: 9 additions & 14 deletions exercises/yacht/description.md → exercises/yacht/instructions.md
@@ -1,8 +1,12 @@
# Description
# Instructions

The dice game [Yacht][yacht] is from the same family as Poker Dice, Generala and particularly Yahtzee, of which it is a precursor.
In the game, five dice are rolled and the result can be entered in any of twelve categories.
The score of a throw of the dice depends on category chosen.
Given five dice and a category, calculate the score of the dice for that category.

~~~~exercism/note
You'll always be presented with five dice.
Each dice's value will be between one and six inclusively.
The dice may be unordered.
~~~~

## Scores in Yacht

Expand All @@ -21,15 +25,6 @@ The score of a throw of the dice depends on category chosen.
| Choice | Sum of the dice | Any combination | 2 3 3 4 6 scores 18 |
| Yacht | 50 points | All five dice showing the same face | 4 4 4 4 4 scores 50 |

If the dice do not satisfy the requirements of a category, the score is zero.
If the dice do **not** satisfy the requirements of a category, the score is zero.
If, for example, _Four Of A Kind_ is entered in the _Yacht_ category, zero points are scored.
A _Yacht_ scores zero if entered in the _Full House_ category.

## Task

Given a list of values for five dice and a category, your solution should return the score of the dice for that category.
If the dice do not satisfy the requirements of the category your solution should return 0.
You can assume that five values will always be presented, and the value of each will be between one and six inclusively.
You should not assume that the dice are ordered.

[yacht]: https://en.wikipedia.org/wiki/Yacht_(dice_game)
11 changes: 11 additions & 0 deletions exercises/yacht/introduction.md
@@ -0,0 +1,11 @@
# Introduction

Each year, something new is "all the rage" in your high school.
This year it is a dice game: [Yacht][yacht].

The game of Yacht is from the same family as Poker Dice, Generala and particularly Yahtzee, of which it is a precursor.
The game consists of twelve rounds.
In each, five dice are rolled and the player chooses one of twelve categories.
The chosen category is then used to score the throw of the dice.

[yacht]: https://en.wikipedia.org/wiki/Yacht_(dice_game)

0 comments on commit f7c0c39

Please sign in to comment.