From f9f3b0298862f27c1880c68bbb7b09dd63232541 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 23 Apr 2024 12:23:52 +0200 Subject: [PATCH 1/5] yacht: split into instructions and introduction --- .../yacht/{description.md => instructions.md} | 23 ++++++++----------- exercises/yacht/introduction.md | 7 ++++++ 2 files changed, 16 insertions(+), 14 deletions(-) rename exercises/yacht/{description.md => instructions.md} (67%) create mode 100644 exercises/yacht/introduction.md diff --git a/exercises/yacht/description.md b/exercises/yacht/instructions.md similarity index 67% rename from exercises/yacht/description.md rename to exercises/yacht/instructions.md index 194ade6e7f..8cfd38ae86 100644 --- a/exercises/yacht/description.md +++ b/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 will be unordered. +~~~~ ## Scores in Yacht @@ -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) diff --git a/exercises/yacht/introduction.md b/exercises/yacht/introduction.md new file mode 100644 index 0000000000..1fedaba440 --- /dev/null +++ b/exercises/yacht/introduction.md @@ -0,0 +1,7 @@ +# Introduction + +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 the category chosen. + +[yacht]: https://en.wikipedia.org/wiki/Yacht_(dice_game) From 1acd4ad75cda2574d4d09a3830d868194f768dc3 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 24 Apr 2024 07:38:11 +0200 Subject: [PATCH 2/5] Update exercises/yacht/introduction.md Co-authored-by: Isaac Good --- exercises/yacht/introduction.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/exercises/yacht/introduction.md b/exercises/yacht/introduction.md index 1fedaba440..f5eabf248a 100644 --- a/exercises/yacht/introduction.md +++ b/exercises/yacht/introduction.md @@ -1,7 +1,9 @@ # Introduction 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 the category chosen. +```suggestion +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) From af99a9aee4a644b4408ff9814f934c29448cf6ef Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 24 Apr 2024 07:38:17 +0200 Subject: [PATCH 3/5] Update exercises/yacht/instructions.md Co-authored-by: Isaac Good --- exercises/yacht/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/yacht/instructions.md b/exercises/yacht/instructions.md index 8cfd38ae86..519b7a68b8 100644 --- a/exercises/yacht/instructions.md +++ b/exercises/yacht/instructions.md @@ -5,7 +5,7 @@ Given five dice and a category, calculate the score of the dice for that categor ~~~~exercism/note You'll always be presented with five dice. Each dice's value will be between one and six inclusively. -The dice will be unordered. +The dice may be unordered. ~~~~ ## Scores in Yacht From c07e8ef679bb7d5f55f64e629641891137b45c89 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 24 Apr 2024 11:17:03 +0200 Subject: [PATCH 4/5] Fix formatting --- exercises/yacht/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/yacht/introduction.md b/exercises/yacht/introduction.md index f5eabf248a..424efed31c 100644 --- a/exercises/yacht/introduction.md +++ b/exercises/yacht/introduction.md @@ -1,7 +1,7 @@ # Introduction The dice game [Yacht][yacht] is from the same family as Poker Dice, Generala and particularly Yahtzee, of which it is a precursor. -```suggestion + 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. From f149043aedf9036e01baa749d8b8640064e4d7ad Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Thu, 25 Apr 2024 09:24:57 +0200 Subject: [PATCH 5/5] Add teeny story --- exercises/yacht/introduction.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/exercises/yacht/introduction.md b/exercises/yacht/introduction.md index 424efed31c..5b541f5625 100644 --- a/exercises/yacht/introduction.md +++ b/exercises/yacht/introduction.md @@ -1,7 +1,9 @@ # Introduction -The dice game [Yacht][yacht] is from the same family as Poker Dice, Generala and particularly Yahtzee, of which it is a precursor. +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.