File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed
exercises/practice/two-fer/.docs Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 11# Instructions
22
3- ` Two-fer ` or ` 2-fer ` is short for two for one. One for you and one for me .
3+ Your task is to determine what you will say as you give away the extra cookie .
44
5- Given a name, return a string with the message :
5+ If your friend likes cookies, and is named Do-yun, then you will say :
66
77``` text
8- One for name , one for me.
8+ One for Do-yun , one for me.
99```
1010
11- Where "name" is the given name.
12-
13- However, if the name is missing, return the string:
11+ If your friend doesn't like cookies, you give the cookie to the next person in line at the bakery.
12+ Since you don't know their name, you will say _ you_ instead.
1413
1514``` text
1615One for you, one for me.
1716```
1817
1918Here are some examples:
2019
21- |Name |String to return
20+ |Name |Dialogue
2221|:-------|:------------------
2322|Alice |One for Alice, one for me.
24- |Bob |One for Bob , one for me.
23+ |Bohdan |One for Bohdan , one for me.
2524| |One for you, one for me.
2625|Zaphod |One for Zaphod, one for me.
Original file line number Diff line number Diff line change 1+ # Introduction
2+
3+ In some English accents, when you say "two for" quickly, it sounds like "two fer".
4+ Two-for-one is a way of saying that if you buy one, you also get one for free.
5+ So the phrase "two-fer" often implies a two-for-one offer.
6+
7+ Imagine a bakery that has a holiday offer where you can buy two cookies for the price of one ("two-fer one!").
8+ You go for the offer and (very generously) decide to give the extra cookie to a friend.
You can’t perform that action at this time.
0 commit comments