1
1
Fork 0
exercism/jq/two-fer
Christina Sørensen 1e351d9c3e
feat(jq): two-fer, resistor-color, resistor-color-duo, leap, isogram, flatten-array
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
2024-12-16 08:26:51 +01:00
..
.exercism feat(jq): two-fer, resistor-color, resistor-color-duo, leap, isogram, flatten-array 2024-12-16 08:26:51 +01:00
bats-extra.bash feat(jq): two-fer, resistor-color, resistor-color-duo, leap, isogram, flatten-array 2024-12-16 08:26:51 +01:00
bats-jq.bash feat(jq): two-fer, resistor-color, resistor-color-duo, leap, isogram, flatten-array 2024-12-16 08:26:51 +01:00
HELP.md feat(jq): two-fer, resistor-color, resistor-color-duo, leap, isogram, flatten-array 2024-12-16 08:26:51 +01:00
README.md feat(jq): two-fer, resistor-color, resistor-color-duo, leap, isogram, flatten-array 2024-12-16 08:26:51 +01:00
test-two-fer.bats feat(jq): two-fer, resistor-color, resistor-color-duo, leap, isogram, flatten-array 2024-12-16 08:26:51 +01:00
two-fer.jq feat(jq): two-fer, resistor-color, resistor-color-duo, leap, isogram, flatten-array 2024-12-16 08:26:51 +01:00

Two Fer

Welcome to Two Fer on Exercism's jq Track. If you need help running the tests or submitting your code, check out HELP.md.

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.

Instructions

Your task is to determine what you will say as you give away the extra cookie.

If you know the person's name (e.g. if they're named Do-yun), then you will say:

One for Do-yun, one for me.

If you don't know the person's 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.

Source

Created by

  • @glennj

Based on

https://github.com/exercism/problem-specifications/issues/757