Skip to content

Commit

Permalink
two-fer: sync (#1882)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSchierboom authored Mar 30, 2024
1 parent 78c84bf commit 0e74678
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
22 changes: 10 additions & 12 deletions exercises/practice/two-fer/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
# 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 you know the person's name (e.g. if they're 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 you don't know the person's name, you will say _you_ instead.

```text
One for you, one for me.
```

Here are some examples:

|Name |String to return
|:-------|:------------------
|Alice |One for Alice, one for me.
|Bob |One for Bob, one for me.
| |One for you, one for me.
|Zaphod |One for Zaphod, one for me.
| Name | Dialogue |
| :----- | :-------------------------- |
| Alice | One for Alice, one for me. |
| Bohdan | One for Bohdan, one for me. |
| | One for you, one for me. |
| Zaphod | One for Zaphod, one for me. |
8 changes: 8 additions & 0 deletions exercises/practice/two-fer/.docs/introduction.md
Original file line number Diff line number Diff line change
@@ -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 take the offer and (very generously) decide to give the extra cookie to someone else in the queue.

0 comments on commit 0e74678

Please sign in to comment.