Skip to content

Commit ed309d4

Browse files
authored
Update instructions for back door process and clarify empty line handling (#875)
1 parent d873116 commit ed309d4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

exercises/concept/poetry-club/.docs/instructions.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ splitOnNewlines("Hello.\nHow are you?\n\nI'm doing fine.")
2424
1. The guard will recite a poem
2525
2. You will have to split the poem into individual lines.
2626
3. You will have to get the first letter of each line.
27+
- If the line is empty, you should use `_` instead.
2728
4. You will have to ensable the letters, which will form a word.
2829

2930
For example, one of their favorite writers is Michael Lockwood, who's written the following _acrostic_ poem, which means that the first letter of each sentence form a word:
@@ -58,7 +59,7 @@ Because this is not for everyone, the back door process is a bit more convoluted
5859
2. You will have to split the poem into lines.
5960
3. You will have to get the last letter of each line.
6061
- The line will sometimes have trailing spaces, so you will need to strip them off.
61-
4. You will have to assemble the letters and then add `", please."` to the end of the word formed by the letters.
62+
4. You will have to assemble the letters and then add `", please"` to the end of the word formed by the letters.
6263

6364
For example, the poem mentioned before is also _telestich_, which means that the last letter of each sentence form a word:
6465

@@ -72,15 +73,15 @@ Eager to leave
7273

7374
When the guard recites the poem, you will split it into individual lines, strip off any trailing spaces, and respond with the first letters of each line, i.e. `["h", "o", "r", "s", "e"]`.
7475

75-
The guard will then give you the word formed by the array of letters you replied with for you to put into capitalized word form and append `", please."`.
76-
Finally the password you return is `"horse, please."`, and you'll get in.
76+
The guard will then give you the word formed by the array of letters you replied with for you to put into capitalized word form and append `", please"`.
77+
Finally the password you return is `"horse, please"`, and you'll get in.
7778

7879
Implement the function `backDoorPassword` that takes a string which represents the poem.
7980
The function should return the password that you would give to the guard.
8081

8182
```swift
8283
backDoorPassword("Stands so high\nHuge hooves too\nImpatiently waits for\nReins and harness\nEager to leave")
83-
// returns "horse, please."
84+
// returns "horse, please"
8485
```
8586

8687
## 4. Secret room

0 commit comments

Comments
 (0)