Skip to content

Commit cca5b95

Browse files
Exchange complex ASCII heart with a simple box (#1557)
1 parent 0d3bc4f commit cca5b95

4 files changed

Lines changed: 18 additions & 73 deletions

File tree

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
11
# Instructions
22

3-
In this exercise, you are going to help high school sweethearts profess their love on social media by generating an ASCII heart with their initials:
3+
In this exercise, you are going to help high school sweethearts profess their love on social media by generating an ASCII box with their initials:
44

55
```
6-
****** ******
7-
** ** ** **
8-
** ** ** **
9-
** * **
10-
** **
11-
** J. K. + M. B. **
12-
** **
13-
** **
14-
** **
15-
** **
16-
** **
17-
** **
18-
***
19-
*
6+
❤-------------------❤
7+
| J. K. + M. B. |
8+
❤-------------------❤
209
```
2110

2211
## 1. Get the name's first letter
@@ -46,26 +35,15 @@ HighSchoolSweetheart.initials("Lance Green")
4635
# => "L. G."
4736
```
4837

49-
## 4. Put the initials inside of the heart
38+
## 4. Put the initials inside of the ASCII box
5039

51-
Implement the `HighSchoolSweetheart.pair/2` function. It should take two full names and return the initials inside an ASCII heart. Make sure to reuse `HighSchoolSweetheart.initials/1` that you defined in the previous step.
40+
Implement the `HighSchoolSweetheart.pair/2` function. It should take two full names and return the initials inside an ASCII box. You don't need to draw the box yourself - make use of the box included in the code comment. Make sure to reuse `HighSchoolSweetheart.initials/1` that you defined in the previous step.
5241

5342
```elixir
5443
HighSchoolSweetheart.pair("Blake Miller", "Riley Lewis")
5544
# => """
56-
# ****** ******
57-
# ** ** ** **
58-
# ** ** ** **
59-
# ** * **
60-
# ** **
61-
# ** B. M. + R. L. **
62-
# ** **
63-
# ** **
64-
# ** **
65-
# ** **
66-
# ** **
67-
# ** **
68-
# ***
69-
# *
45+
# ❤-------------------❤
46+
# | B. M. + R. L. |
47+
# ❤-------------------❤
7048
# """
7149
```

exercises/concept/high-school-sweetheart/.meta/exemplar.ex

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,9 @@ defmodule HighSchoolSweetheart do
2222
i2 = initials(full_name2)
2323

2424
"""
25-
****** ******
26-
** ** ** **
27-
** ** ** **
28-
** * **
29-
** **
30-
** #{i1} + #{i2} **
31-
** **
32-
** **
33-
** **
34-
** **
35-
** **
36-
** **
37-
***
38-
*
25+
❤-------------------❤
26+
| #{i1} + #{i2} |
27+
❤-------------------❤
3928
"""
4029
end
4130
end

exercises/concept/high-school-sweetheart/lib/high_school_sweetheart.ex

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,9 @@ defmodule HighSchoolSweetheart do
1212
end
1313

1414
def pair(full_name1, full_name2) do
15-
# ****** ******
16-
# ** ** ** **
17-
# ** ** ** **
18-
# ** * **
19-
# ** **
20-
# ** X. X. + X. X. **
21-
# ** **
22-
# ** **
23-
# ** **
24-
# ** **
25-
# ** **
26-
# ** **
27-
# ***
28-
# *
15+
# ❤-------------------❤
16+
# | X. X. + X. X. |
17+
# ❤-------------------❤
2918

3019
# Please implement the pair/2 function
3120
end

exercises/concept/high-school-sweetheart/test/high_school_sweetheart_test.exs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,9 @@ defmodule HighSchoolSweetheartTest do
4242
test "prints the pair's initials inside a heart" do
4343
assert HighSchoolSweetheart.pair("Avery Bryant", "Charlie Dixon") ==
4444
"""
45-
****** ******
46-
** ** ** **
47-
** ** ** **
48-
** * **
49-
** **
50-
** A. B. + C. D. **
51-
** **
52-
** **
53-
** **
54-
** **
55-
** **
56-
** **
57-
***
58-
*
45+
❤-------------------❤
46+
| A. B. + C. D. |
47+
❤-------------------❤
5948
"""
6049
end
6150
end

0 commit comments

Comments
 (0)