Skip to content

Commit 3162bd4

Browse files
authored
Synced instructions and introduction files from problem specs. (#3423)
1 parent 2165826 commit 3162bd4

File tree

26 files changed

+82
-94
lines changed

26 files changed

+82
-94
lines changed

exercises/practice/accumulate/.docs/instructions.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Instructions
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/practice/binary-search/.docs/instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Binary search only works when a list has been sorted.
1111

1212
The algorithm looks like this:
1313

14-
- Find the middle element of a sorted list and compare it with the item we're looking for.
14+
- Find the middle element of a *sorted* list and compare it with the item we're looking for.
1515
- If the middle element is our item, then we're done!
1616
- If the middle element is greater than our item, we can eliminate that element and all the elements **after** it.
1717
- If the middle element is less than our item, we can eliminate that element and all the elements **before** it.

exercises/practice/binary/.docs/instructions.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/practice/book-store/.docs/instructions.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ If you buy 4 different books, you get a 20% discount.
1212

1313
If you buy all 5, you get a 25% discount.
1414

15-
Note: that if you buy four books, of which 3 are different titles, you get a 10% discount on the 3 that form part of a set, but the fourth book still costs $8.
15+
Note that if you buy four books, of which 3 are different titles, you get a 10% discount on the 3 that form part of a set, but the fourth book still costs $8.
1616

17-
Your mission is to write a piece of code to calculate the price of any conceivable shopping basket (containing only books of the same series), giving as big a discount as possible.
17+
Your mission is to write code to calculate the price of any conceivable shopping basket (containing only books of the same series), giving as big a discount as possible.
1818

1919
For example, how much does this basket of books cost?
2020

@@ -26,36 +26,36 @@ For example, how much does this basket of books cost?
2626

2727
One way of grouping these 8 books is:
2828

29-
- 1 group of 5 --> 25% discount (1st,2nd,3rd,4th,5th)
30-
- +1 group of 3 --> 10% discount (1st,2nd,3rd)
29+
- 1 group of 5 (1st, 2nd,3rd, 4th, 5th)
30+
- 1 group of 3 (1st, 2nd, 3rd)
3131

3232
This would give a total of:
3333

3434
- 5 books at a 25% discount
35-
- +3 books at a 10% discount
35+
- 3 books at a 10% discount
3636

3737
Resulting in:
3838

39-
- 5 × (8 - 2.00) = 5 × 6.00 = $30.00
40-
- +3 × (8 - 0.80) = 3 × 7.20 = $21.60
39+
- 5 × (100% - 25%) * $8 = 5 × $6.00 = $30.00, plus
40+
- 3 × (100% - 10%) * $8 = 3 × $7.20 = $21.60
4141

42-
For a total of $51.60
42+
Which equals $51.60.
4343

4444
However, a different way to group these 8 books is:
4545

46-
- 1 group of 4 books --> 20% discount (1st,2nd,3rd,4th)
47-
- +1 group of 4 books --> 20% discount (1st,2nd,3rd,5th)
46+
- 1 group of 4 books (1st, 2nd, 3rd, 4th)
47+
- 1 group of 4 books (1st, 2nd, 3rd, 5th)
4848

4949
This would give a total of:
5050

5151
- 4 books at a 20% discount
52-
- +4 books at a 20% discount
52+
- 4 books at a 20% discount
5353

5454
Resulting in:
5555

56-
- 4 × (8 - 1.60) = 4 × 6.40 = $25.60
57-
- +4 × (8 - 1.60) = 4 × 6.40 = $25.60
56+
- 4 × (100% - 20%) * $8 = 4 × $6.40 = $25.60, plus
57+
- 4 × (100% - 20%) * $8 = 4 × $6.40 = $25.60
5858

59-
For a total of $51.20
59+
Which equals $51.20.
6060

6161
And $51.20 is the price with the biggest discount.

exercises/practice/bowling/.docs/instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Frame 3 is (9 + 0) = 9
3636
This means the current running total is 48.
3737

3838
The tenth frame in the game is a special case.
39-
If someone throws a strike or a spare then they get a fill ball.
39+
If someone throws a spare or a strike then they get one or two fill balls respectively.
4040
Fill balls exist to calculate the total of the 10th frame.
4141
Scoring a strike or spare on the fill ball does not give the player more fill balls.
4242
The total value of the 10th frame is the total number of pins knocked down.

exercises/practice/darts/.docs/instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ In our particular instance of the game, the target rewards 4 different amounts o
1212
- If the dart lands in the inner circle of the target, player earns 10 points.
1313

1414
The outer circle has a radius of 10 units (this is equivalent to the total radius for the entire target), the middle circle a radius of 5 units, and the inner circle a radius of 1.
15-
Of course, they are all centered at the same point (that is, the circles are [concentric][] defined by the coordinates (0, 0).
15+
Of course, they are all centered at the same point that is, the circles are [concentric][] defined by the coordinates (0, 0).
1616

1717
Write a function that given a point in the target (defined by its [Cartesian coordinates][cartesian-coordinates] `x` and `y`, where `x` and `y` are [real][real-numbers]), returns the correct amount earned by a dart landing at that point.
1818

exercises/practice/error-handling/.docs/instructions.md

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

33
Implement various kinds of error handling and resource management.
44

5-
An important point of programming is how to handle errors and close
6-
resources even if errors occur.
5+
An important point of programming is how to handle errors and close resources even if errors occur.
76

8-
This exercise requires you to handle various errors. Because error handling
9-
is rather programming language specific you'll have to refer to the tests
10-
for your track to see what's exactly required.
7+
This exercise requires you to handle various errors.
8+
Because error handling is rather programming language specific you'll have to refer to the tests for your track to see what's exactly required.

exercises/practice/gigasecond/.docs/introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ Then we can use metric system prefixes for writing large numbers of seconds in m
1313
- Perhaps you and your family would travel to somewhere exotic for two megaseconds (that's two million seconds).
1414
- And if you and your spouse were married for _a thousand million_ seconds, you would celebrate your one gigasecond anniversary.
1515

16-
```exercism/note
16+
~~~~exercism/note
1717
If we ever colonize Mars or some other planet, measuring time is going to get even messier.
1818
If someone says "year" do they mean a year on Earth or a year on Mars?
1919
2020
The idea for this exercise came from the science fiction novel ["A Deepness in the Sky"][vinge-novel] by author Vernor Vinge.
2121
In it the author uses the metric system as the basis for time measurements.
2222
2323
[vinge-novel]: https://www.tor.com/2017/08/03/science-fiction-with-something-for-everyone-a-deepness-in-the-sky-by-vernor-vinge/
24-
```
24+
~~~~

exercises/practice/hexadecimal/.docs/instructions.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
Convert a hexadecimal number, represented as a string (e.g. "10af8c"), to its decimal equivalent using first principles (i.e. no, you may not use built-in or external libraries to accomplish the conversion).
44

5-
On the web we use hexadecimal to represent colors, e.g. green: 008000,
6-
teal: 008080, navy: 000080).
5+
On the web we use hexadecimal to represent colors, e.g. green: 008000, teal: 008080, navy: 000080).
76

87
The program should handle invalid hexadecimal strings.

exercises/practice/killer-sudoku-helper/.docs/instructions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ The screenshots above have been generated using [F-Puzzles.com](https://www.f-pu
5656

5757
[sudoku-rules]: https://masteringsudoku.com/sudoku-rules-beginners/
5858
[killer-guide]: https://masteringsudoku.com/killer-sudoku/
59-
[one-solution-img]: https://media.githubusercontent.com/media/exercism/v3-files/main/julia/killer-sudoku-helper/example1.png
60-
[four-solutions-img]: https://media.githubusercontent.com/media/exercism/v3-files/main/julia/killer-sudoku-helper/example2.png
61-
[not-possible-img]: https://media.githubusercontent.com/media/exercism/v3-files/main/julia/killer-sudoku-helper/example3.png
59+
[one-solution-img]: https://exercism-v3-icons.s3.eu-west-2.amazonaws.com/images/exercises/killer-sudoku-helper/example1.png
60+
[four-solutions-img]: https://exercism-v3-icons.s3.eu-west-2.amazonaws.com/images/exercises/killer-sudoku-helper/example2.png
61+
[not-possible-img]: https://exercism-v3-icons.s3.eu-west-2.amazonaws.com/images/exercises/killer-sudoku-helper/example3.png
6262
[clover-puzzle]: https://app.crackingthecryptic.com/sudoku/HqTBn3Pr6R
6363
[goodliffe-video]: https://youtu.be/c_NjEbFEeW0?t=1180

exercises/practice/linked-list/.docs/instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Sometimes a station gets closed down, and in that case the station needs to be r
1313

1414
The size of a route is measured not by how far the train travels, but by how many stations it stops at.
1515

16-
```exercism/note
16+
~~~~exercism/note
1717
The linked list is a fundamental data structure in computer science, often used in the implementation of other data structures.
1818
As the name suggests, it is a list of nodes that are linked together.
1919
It is a list of "nodes", where each node links to its neighbor or neighbors.
@@ -23,4 +23,4 @@ In a **doubly linked list** each node links to both the node that comes before,
2323
If you want to dig deeper into linked lists, check out [this article][intro-linked-list] that explains it using nice drawings.
2424
2525
[intro-linked-list]: https://medium.com/basecs/whats-a-linked-list-anyway-part-1-d8b7e6508b9d
26-
```
26+
~~~~

exercises/practice/nucleotide-count/.docs/instructions.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Instructions
22

3-
Each of us inherits from our biological parents a set of chemical instructions known as DNA that influence how our bodies are constructed. All known life depends on DNA!
3+
Each of us inherits from our biological parents a set of chemical instructions known as DNA that influence how our bodies are constructed.
4+
All known life depends on DNA!
45

56
> Note: You do not need to understand anything about nucleotides or DNA to complete this exercise.
67
7-
DNA is a long chain of other chemicals and the most important are the four nucleotides, adenine, cytosine, guanine and thymine. A single DNA chain can contain billions of these four nucleotides and the order in which they occur is important!
8+
DNA is a long chain of other chemicals and the most important are the four nucleotides, adenine, cytosine, guanine and thymine.
9+
A single DNA chain can contain billions of these four nucleotides and the order in which they occur is important!
810
We call the order of these nucleotides in a bit of DNA a "DNA sequence".
911

1012
We represent a DNA sequence as an ordered collection of these four nucleotides and a common way to do that is with a string of characters such as "ATTACG" for a DNA sequence of 6 nucleotides.

exercises/practice/octal/.docs/instructions.md

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

3-
Convert an octal number, represented as a string (e.g. '1735263'), to its
4-
decimal equivalent using first principles (i.e. no, you may not use built-in or
5-
external libraries to accomplish the conversion).
3+
Convert an octal number, represented as a string (e.g. '1735263'), to its decimal equivalent using first principles (i.e. no, you may not use built-in or external libraries to accomplish the conversion).
64

7-
Implement octal to decimal conversion. Given an octal input
8-
string, your program should produce a decimal output.
5+
Implement octal to decimal conversion.
6+
Given an octal input string, your program should produce a decimal output.
97

108
## Note
119

exercises/practice/pangram/.docs/instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ Your task is to figure out if a sentence is a pangram.
55
A pangram is a sentence using every letter of the alphabet at least once.
66
It is case insensitive, so it doesn't matter if a letter is lower-case (e.g. `k`) or upper-case (e.g. `K`).
77

8-
For this exercise we only use the basic letters used in the English alphabet: `a` to `z`.
8+
For this exercise, a sentence is a pangram if it contains each of the 26 letters in the English alphabet.

exercises/practice/pangram/.docs/introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ To give a comprehensive sense of the font, the random sentences should use **all
77
They're running a competition to get suggestions for sentences that they can use.
88
You're in charge of checking the submissions to see if they are valid.
99

10-
```exercism/note
10+
~~~~exercism/note
1111
Pangram comes from Greek, παν γράμμα, pan gramma, which means "every letter".
1212
1313
The best known English pangram is:
1414
1515
> The quick brown fox jumps over the lazy dog.
16-
```
16+
~~~~

exercises/practice/parallel-letter-frequency/.docs/instructions.md

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

33
Count the frequency of letters in texts using parallel computation.
44

5-
Parallelism is about doing things in parallel that can also be done
6-
sequentially. A common example is counting the frequency of letters.
7-
Create a function that returns the total frequency of each letter in a
8-
list of texts and that employs parallelism.
5+
Parallelism is about doing things in parallel that can also be done sequentially.
6+
A common example is counting the frequency of letters.
7+
Create a function that returns the total frequency of each letter in a list of texts and that employs parallelism.

exercises/practice/queen-attack/.docs/instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ So if you are told the white queen is at `c5` (zero-indexed at column 2, row 3)
2121
a b c d e f g h
2222
```
2323

24-
You are also be able to answer whether the queens can attack each other.
24+
You are also able to answer whether the queens can attack each other.
2525
In this case, that answer would be yes, they can, because both pieces share a diagonal.

exercises/practice/roman-numerals/.docs/instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ In Roman numerals 1990 is MCMXC:
3636
2000=MM
3737
8=VIII
3838

39-
Learn more about [Roman numberals on Wikipedia][roman-numerals].
39+
Learn more about [Roman numerals on Wikipedia][roman-numerals].
4040

4141
[roman-numerals]: https://wiki.imperivm-romanvm.com/wiki/Roman_Numerals

exercises/practice/saddle-points/.docs/instructions.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,22 @@ Your task is to find the potential trees where you could build your tree house.
55
The data company provides the data as grids that show the heights of the trees.
66
The rows of the grid represent the east-west direction, and the columns represent the north-south direction.
77

8-
An acceptable tree will be the the largest in its row, while being the smallest in its column.
8+
An acceptable tree will be the largest in its row, while being the smallest in its column.
99

1010
A grid might not have any good trees at all.
1111
Or it might have one, or even several.
1212

1313
Here is a grid that has exactly one candidate tree.
1414

15+
```text
1516
1 2 3 4
1617
|-----------
1718
1 | 9 8 7 8
1819
2 | 5 3 2 4 <--- potential tree house at row 2, column 1, for tree with height 5
1920
3 | 6 6 7 1
21+
```
2022

21-
- Row 2 has values 5, 3, and 1. The largest value is 5.
23+
- Row 2 has values 5, 3, 2, and 4. The largest value is 5.
2224
- Column 1 has values 9, 5, and 6. The smallest value is 5.
2325

2426
So the point at `[2, 1]` (row: 2, column: 1) is a great spot for a tree house.
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# Introduction
22

3-
You are planning on building a tree house in the woods near your house so that you can watch the sun rise and set.
3+
You plan to build a tree house in the woods near your house so that you can watch the sun rise and set.
44

5-
You've obtained data from a local survey company that shows the heights of all the trees in each rectangular section of the map.
6-
You need to analyze each grid on the map to find the perfect tree for your tree house.
5+
You've obtained data from a local survey company that show the height of every tree in each rectangular section of the map.
6+
You need to analyze each grid on the map to find good trees for your tree house.
77

8-
The best tree will be the tallest tree compared to all the other trees to the east and west, so that you have the best possible view of the sunrises and sunsets.
9-
You don't like climbing too much, so the perfect tree will also be the shortest among all the trees to the north and to the south.
8+
A good tree is both:
9+
10+
- taller than every tree to the east and west, so that you have the best possible view of the sunrises and sunsets.
11+
- shorter than every tree to the north and south, to minimize the amount of tree climbing.

exercises/practice/secret-handshake/.docs/instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,6 @@ jump, double blink
4343

4444
~~~~exercism/note
4545
If you aren't sure what binary is or how it works, check out [this binary tutorial][intro-to-binary].
46+
4647
[intro-to-binary]: https://medium.com/basecs/bits-bytes-building-with-binary-13cb4289aafa
4748
~~~~

exercises/practice/sieve/.docs/instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ Then you repeat the following steps:
1818
You keep repeating these steps until you've gone through every number in your list.
1919
At the end, all the unmarked numbers are prime.
2020

21-
```exercism/note
21+
~~~~exercism/note
2222
[Wikipedia's Sieve of Eratosthenes article][eratosthenes] has a useful graphic that explains the algorithm.
2323
2424
The tests don't check that you've implemented the algorithm, only that you've come up with the correct list of primes.
2525
A good first test is to check that you do not use division or remainder operations.
2626
2727
[eratosthenes]: https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
28-
```
28+
~~~~

exercises/practice/strain/.docs/instructions.md

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

3-
Implement the `keep` and `discard` operation on collections. Given a collection
4-
and a predicate on the collection's elements, `keep` returns a new collection
5-
containing those elements where the predicate is true, while `discard` returns
6-
a new collection containing those elements where the predicate is false.
3+
Implement the `keep` and `discard` operation on collections.
4+
Given a collection and a predicate on the collection's elements, `keep` returns a new collection containing those elements where the predicate is true, while `discard` returns a new collection containing those elements where the predicate is false.
75

86
For example, given the collection of numbers:
97

@@ -23,12 +21,9 @@ While your discard operation should produce:
2321

2422
Note that the union of keep and discard is all the elements.
2523

26-
The functions may be called `keep` and `discard`, or they may need different
27-
names in order to not clash with existing functions or concepts in your
28-
language.
24+
The functions may be called `keep` and `discard`, or they may need different names in order to not clash with existing functions or concepts in your language.
2925

3026
## Restrictions
3127

32-
Keep your hands off that filter/reject/whatchamacallit functionality
33-
provided by your standard library! Solve this one yourself using other
34-
basic tools instead.
28+
Keep your hands off that filter/reject/whatchamacallit functionality provided by your standard library!
29+
Solve this one yourself using other basic tools instead.

exercises/practice/sum-of-multiples/.docs/instructions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ The points awarded depend on two things:
77
- The level (a number) that the player completed.
88
- The base value of each magical item collected by the player during that level.
99

10-
The energy points are awarded according to the following rules:
10+
The energy points are awarded according to the following rules:
1111

1212
1. For each magical item, take the base value and find all the multiples of that value that are less than the level number.
1313
2. Combine the sets of numbers.
1414
3. Remove any duplicates.
15-
4. Calculate the sum of all the numbers that are left.
15+
4. Calculate the sum of all the numbers that are left.
1616

1717
Let's look at an example:
1818

@@ -24,4 +24,4 @@ To calculate the energy points earned by the player, we need to find all the uni
2424
- Multiples of 5 less than 20: `{5, 10, 15}`
2525
- Combine the sets and remove duplicates: `{3, 5, 6, 9, 10, 12, 15, 18}`
2626
- Sum the unique multiples: `3 + 5 + 6 + 9 + 10 + 12 + 15 + 18 = 78`
27-
- Therefore, the player earns **78** energy points for completing level 20 and finding the two magical items with base values of 3 and 5
27+
- Therefore, the player earns **78** energy points for completing level 20 and finding the two magical items with base values of 3 and 5.

0 commit comments

Comments
 (0)