Skip to content

Commit fb1da70

Browse files
authored
Reformat one sentence per line (#2118)
This updates the exercise descriptions to have one sentence per line, to conform to the Exerism Markdown Specification. There are a couple of deprecated exercises that I didn't touch. There are also a couple of files that have open PRs that are fixing the one sentence per line thing as part of a bigger overhaul, so I didn't touch those either. There's a chance that I missed a spot here and there, as this task was too messy to automate properly. (I could have done so, but then it would have been roughly the same amount of work as doing it manually, and it still probably would have gone wrong. So I didn't bother with a script).
1 parent 553c85f commit fb1da70

File tree

109 files changed

+618
-842
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+618
-842
lines changed

exercises/accumulate/description.md

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

3-
Implement the `accumulate` operation, which, given a collection and an
4-
operation to perform on each element of the collection, returns a new
5-
collection containing the result of applying that operation to each element of
6-
the input collection.
3+
Implement the `accumulate` operation, which, given a collection and an operation to perform on each element of the collection, returns a new collection containing the result of applying that operation to each element of the input collection.
74

85
Given the collection of numbers:
96

@@ -21,6 +18,5 @@ Check out the test suite to see the expected function signature.
2118

2219
## Restrictions
2320

24-
Keep your hands off that collect/map/fmap/whatchamacallit functionality
25-
provided by your standard library!
21+
Keep your hands off that collect/map/fmap/whatchamacallit functionality provided by your standard library!
2622
Solve this one yourself using other basic tools instead.

exercises/all-your-base/description.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
Convert a number, represented as a sequence of digits in one base, to any other base.
44

5-
Implement general base conversion. Given a number in base **a**,
6-
represented as a sequence of digits, convert it to base **b**.
5+
Implement general base conversion.
6+
Given a number in base **a**, represented as a sequence of digits, convert it to base **b**.
77

88
## Note
99

@@ -12,8 +12,7 @@ represented as a sequence of digits, convert it to base **b**.
1212

1313
## About [Positional Notation][positional-notation]
1414

15-
In positional notation, a number in base **b** can be understood as a linear
16-
combination of powers of **b**.
15+
In positional notation, a number in base **b** can be understood as a linear combination of powers of **b**.
1716

1817
The number 42, *in base 10*, means:
1918

exercises/allergies/description.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
Given a person's allergy score, determine whether or not they're allergic to a given item, and their full list of allergies.
44

5-
An allergy test produces a single numeric score which contains the
6-
information about all the allergies the person has (that they were
7-
tested for).
5+
An allergy test produces a single numeric score which contains the information about all the allergies the person has (that they were tested for).
86

97
The list of items (and their value) that were tested are:
108

@@ -24,7 +22,6 @@ Now, given just that score of 34, your program should be able to say:
2422
* Whether Tom is allergic to any one of those allergens listed above.
2523
* All the allergens Tom is allergic to.
2624

27-
Note: a given score may include allergens **not** listed above (i.e.
28-
allergens that score 256, 512, 1024, etc.). Your program should
29-
ignore those components of the score. For example, if the allergy
30-
score is 257, your program should only report the eggs (1) allergy.
25+
Note: a given score may include allergens **not** listed above (i.e. allergens that score 256, 512, 1024, etc.).
26+
Your program should ignore those components of the score.
27+
For example, if the allergy score is 257, your program should only report the eggs (1) allergy.

exercises/alphametics/description.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@ Replacing these with valid numbers gives:
2222
1 0 6 5 2
2323
```
2424

25-
This is correct because every letter is replaced by a different number and the
26-
words, translated into numbers, then make a valid sum.
25+
This is correct because every letter is replaced by a different number and the words, translated into numbers, then make a valid sum.
2726

28-
Each letter must represent a different digit, and the leading digit of
29-
a multi-digit number must not be zero.
27+
Each letter must represent a different digit, and the leading digit of a multi-digit number must not be zero.
3028

3129
Write a function to solve alphametics puzzles.
3230

exercises/atbash-cipher/description.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
Create an implementation of the atbash cipher, an ancient encryption system created in the Middle East.
44

5-
The Atbash cipher is a simple substitution cipher that relies on
6-
transposing all the letters in the alphabet such that the resulting
7-
alphabet is backwards. The first letter is replaced with the last
8-
letter, the second with the second-last, and so on.
5+
The Atbash cipher is a simple substitution cipher that relies on transposing all the letters in the alphabet such that the resulting alphabet is backwards.
6+
The first letter is replaced with the last letter, the second with the second-last, and so on.
97

108
An Atbash cipher for the Latin alphabet would be as follows:
119

@@ -14,12 +12,10 @@ Plain: abcdefghijklmnopqrstuvwxyz
1412
Cipher: zyxwvutsrqponmlkjihgfedcba
1513
```
1614

17-
It is a very weak cipher because it only has one possible key, and it is
18-
a simple mono-alphabetic substitution cipher. However, this may not have
19-
been an issue in the cipher's time.
15+
It is a very weak cipher because it only has one possible key, and it is a simple mono-alphabetic substitution cipher.
16+
However, this may not have been an issue in the cipher's time.
2017

21-
Ciphertext is written out in groups of fixed length, the traditional group size
22-
being 5 letters, leaving numbers unchanged, and punctuation is excluded.
18+
Ciphertext is written out in groups of fixed length, the traditional group size being 5 letters, leaving numbers unchanged, and punctuation is excluded.
2319
This is to make it harder to guess things based on word boundaries.
2420
All text will be encoded as lowercase letters.
2521

exercises/bank-account/description.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
# Description
22

3-
Simulate a bank account supporting opening/closing, withdrawals, and deposits
4-
of money. Watch out for concurrent transactions!
3+
Simulate a bank account supporting opening/closing, withdrawals, and deposits of money.
4+
Watch out for concurrent transactions!
55

6-
A bank account can be accessed in multiple ways. Clients can make
7-
deposits and withdrawals using the internet, mobile phones, etc. Shops
8-
can charge against the account.
6+
A bank account can be accessed in multiple ways.
7+
Clients can make deposits and withdrawals using the internet, mobile phones, etc.
8+
Shops can charge against the account.
99

10-
Create an account that can be accessed from multiple threads/processes
11-
(terminology depends on your programming language).
10+
Create an account that can be accessed from multiple threads/processes (terminology depends on your programming language).
1211

13-
It should be possible to close an account; operations against a closed
14-
account must fail.
12+
It should be possible to close an account; operations against a closed account must fail.

exercises/binary-search-tree/description.md

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,22 @@
22

33
Insert and search for numbers in a binary tree.
44

5-
When we need to represent sorted data, an array does not make a good
6-
data structure.
7-
8-
Say we have the array `[1, 3, 4, 5]`, and we add 2 to it so it becomes
9-
`[1, 3, 4, 5, 2]` now we must sort the entire array again! We can
10-
improve on this by realizing that we only need to make space for the new
11-
item `[1, nil, 3, 4, 5]`, and then adding the item in the space we
12-
added. But this still requires us to shift many elements down by one.
13-
14-
Binary Search Trees, however, can operate on sorted data much more
15-
efficiently.
16-
17-
A binary search tree consists of a series of connected nodes. Each node
18-
contains a piece of data (e.g. the number 3), a variable named `left`,
19-
and a variable named `right`. The `left` and `right` variables point at
20-
`nil`, or other nodes. Since these other nodes in turn have other nodes
21-
beneath them, we say that the left and right variables are pointing at
22-
subtrees. All data in the left subtree is less than or equal to the
23-
current node's data, and all data in the right subtree is greater than
24-
the current node's data.
25-
26-
For example, if we had a node containing the data 4, and we added the
27-
data 2, our tree would look like this:
5+
When we need to represent sorted data, an array does not make a good data structure.
6+
7+
Say we have the array `[1, 3, 4, 5]`, and we add 2 to it so it becomes `[1, 3, 4, 5, 2]`.
8+
Now we must sort the entire array again!
9+
We can improve on this by realizing that we only need to make space for the new item `[1, nil, 3, 4, 5]`, and then adding the item in the space we added.
10+
But this still requires us to shift many elements down by one.
11+
12+
Binary Search Trees, however, can operate on sorted data much more efficiently.
13+
14+
A binary search tree consists of a series of connected nodes.
15+
Each node contains a piece of data (e.g. the number 3), a variable named `left`, and a variable named `right`.
16+
The `left` and `right` variables point at `nil`, or other nodes.
17+
Since these other nodes in turn have other nodes beneath them, we say that the left and right variables are pointing at subtrees.
18+
All data in the left subtree is less than or equal to the current node's data, and all data in the right subtree is greater than the current node's data.
19+
20+
For example, if we had a node containing the data 4, and we added the data 2, our tree would look like this:
2821

2922
4
3023
/

exercises/binary-search/description.md

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,23 @@
22

33
Implement a binary search algorithm.
44

5-
Searching a sorted collection is a common task. A dictionary is a sorted
6-
list of word definitions. Given a word, one can find its definition. A
7-
telephone book is a sorted list of people's names, addresses, and
8-
telephone numbers. Knowing someone's name allows one to quickly find
9-
their telephone number and address.
5+
Searching a sorted collection is a common task.
6+
A dictionary is a sorted list of word definitions.
7+
Given a word, one can find its definition.
8+
A telephone book is a sorted list of people's names, addresses, and telephone numbers.
9+
Knowing someone's name allows one to quickly find their telephone number and address.
1010

11-
If the list to be searched contains more than a few items (a dozen, say)
12-
a binary search will require far fewer comparisons than a linear search,
13-
but it imposes the requirement that the list be sorted.
11+
If the list to be searched contains more than a few items (a dozen, say) a binary search will require far fewer comparisons than a linear search, but it imposes the requirement that the list be sorted.
1412

15-
In computer science, a binary search or half-interval search algorithm
16-
finds the position of a specified input value (the search "key") within
17-
an array sorted by key value.
13+
In computer science, a binary search or half-interval search algorithm finds the position of a specified input value (the search "key") within an array sorted by key value.
1814

19-
In each step, the algorithm compares the search key value with the key
20-
value of the middle element of the array.
15+
In each step, the algorithm compares the search key value with the key value of the middle element of the array.
2116

22-
If the keys match, then a matching element has been found and its index,
23-
or position, is returned.
17+
If the keys match, then a matching element has been found and its index, or position, is returned.
2418

25-
Otherwise, if the search key is less than the middle element's key, then
26-
the algorithm repeats its action on the sub-array to the left of the
27-
middle element or, if the search key is greater, on the sub-array to the
28-
right.
19+
Otherwise, if the search key is less than the middle element's key, then the algorithm repeats its action on the sub-array to the left of the middle element or, if the search key is greater, on the sub-array to the right.
2920

30-
If the remaining array to be searched is empty, then the key cannot be
31-
found in the array and a special "not found" indication is returned.
21+
If the remaining array to be searched is empty, then the key cannot be found in the array and a special "not found" indication is returned.
3222

33-
A binary search halves the number of items to check with each iteration,
34-
so locating an item (or determining its absence) takes logarithmic time.
23+
A binary search halves the number of items to check with each iteration, so locating an item (or determining its absence) takes logarithmic time.
3524
A binary search is a dichotomic divide and conquer search algorithm.

exercises/binary/description.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
Convert a binary number, represented as a string (e.g. '101010'), to its decimal equivalent using first principles.
44

5-
Implement binary to decimal conversion. Given a binary input
6-
string, your program should produce a decimal output. The
7-
program should handle invalid inputs.
5+
Implement binary to decimal conversion.
6+
Given a binary input string, your program should produce a decimal output.
7+
The program should handle invalid inputs.
88

99
## Note
1010

@@ -15,8 +15,7 @@ program should handle invalid inputs.
1515

1616
Decimal is a base-10 system.
1717

18-
A number 23 in base 10 notation can be understood
19-
as a linear combination of powers of 10:
18+
A number 23 in base 10 notation can be understood as a linear combination of powers of 10:
2019

2120
- The rightmost digit gets multiplied by 10^0 = 1
2221
- The next number gets multiplied by 10^1 = 10

exercises/bob/description.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Description
22

3-
Bob is a lackadaisical teenager. In conversation, his responses are very limited.
3+
Bob is a lackadaisical teenager.
4+
In conversation, his responses are very limited.
45

56
Bob answers 'Sure.' if you ask him a question, such as "How are you?".
67

78
He answers 'Whoa, chill out!' if you YELL AT HIM (in all capitals).
89

910
He answers 'Calm down, I know what I'm doing!' if you yell a question at him.
1011

11-
He says 'Fine. Be that way!' if you address him without actually saying
12-
anything.
12+
He says 'Fine. Be that way!' if you address him without actually saying anything.
1313

1414
He answers 'Whatever.' to anything else.
1515

0 commit comments

Comments
 (0)