Frédéric G. MARAND 04c3039651 Practice: two-fer. | 8 月之前 | |
---|---|---|
.. | ||
.exercism | 8 月之前 | |
.yarn | 8 月之前 | |
.eslintignore | 8 月之前 | |
.eslintrc.cjs | 8 月之前 | |
.yarnrc.yml | 8 月之前 | |
HELP.md | 8 月之前 | |
README.md | 8 月之前 | |
babel.config.cjs | 8 月之前 | |
jest.config.cjs | 8 月之前 | |
package.json | 8 月之前 | |
tsconfig.json | 8 月之前 | |
two-fer.test.ts | 8 月之前 | |
two-fer.ts | 8 月之前 |
Welcome to Two Fer on Exercism's TypeScript Track.
If you need help running the tests or submitting your code, check out HELP.md
.
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.
Your task is to determine what you will say as you give away the extra cookie.
If your friend likes cookies, and is named Do-yun, then you will say:
One for Do-yun, one for me.
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.
One for you, one for me.
Here are some examples:
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. |
https://github.com/exercism/problem-specifications/issues/757