From 40e8149eccde3a9de6d420baf98622f2bf04777a Mon Sep 17 00:00:00 2001 From: Katrina Owen Date: Fri, 3 Mar 2023 13:18:01 +0100 Subject: [PATCH] Sync two-fer docs with problem-specifications (#262) The two-fer exercise has been overhauled as part of a project to make practice exercises more consistent and friendly. For more context, please see the discussion in the forum, as well as the pull request that updated the exercise in the problem-specifications repository: - https://forum.exercism.org/t/new-project-making-practice-exercises-more-consistent-and-human-across-exercism/3943 - https://github.com/exercism/problem-specifications/pull/2204 --- .../practice/two-fer/.docs/instructions.md | 19 +++++++++---------- .../practice/two-fer/.docs/introduction.md | 8 ++++++++ 2 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 exercises/practice/two-fer/.docs/introduction.md diff --git a/exercises/practice/two-fer/.docs/instructions.md b/exercises/practice/two-fer/.docs/instructions.md index 71e2771..a9bb4a3 100644 --- a/exercises/practice/two-fer/.docs/instructions.md +++ b/exercises/practice/two-fer/.docs/instructions.md @@ -1,16 +1,15 @@ -# Description +# Instructions -`Two-fer` or `2-fer` is short for two for one. One for you and one for me. +Your task is to determine what you will say as you give away the extra cookie. -Given a name, return a string with the message: +If your friend likes cookies, and is named Do-yun, then you will say: ```text -One for name, one for me. +One for Do-yun, one for me. ``` -Where "name" is the given name. - -However, if the name is missing, return the string: +If your friend doesn't like cookies, you give the cookie to the next person in line at the bakery. +Since you don't know their name, you will say _you_ instead. ```text One for you, one for me. @@ -18,9 +17,9 @@ One for you, one for me. Here are some examples: -|Name |String to return +|Name |Dialogue |:-------|:------------------ |Alice |One for Alice, one for me. -|Bob |One for Bob, one for me. +|Bohdan |One for Bohdan, one for me. | |One for you, one for me. -|Zaphod |One for Zaphod, one for me. \ No newline at end of file +|Zaphod |One for Zaphod, one for me. diff --git a/exercises/practice/two-fer/.docs/introduction.md b/exercises/practice/two-fer/.docs/introduction.md new file mode 100644 index 0000000..8c12439 --- /dev/null +++ b/exercises/practice/two-fer/.docs/introduction.md @@ -0,0 +1,8 @@ +# Introduction + +In some English accents, when you say "two for" quickly, it sounds like "two fer". +Two-for-one is a way of saying that if you buy one, you also get one for free. +So the phrase "two-fer" often implies a two-for-one offer. + +Imagine a bakery that has a holiday offer where you can buy two cookies for the price of one ("two-fer one!"). +You go for the offer and (very generously) decide to give the extra cookie to a friend.