Skip to content

Commit dbfbeae

Browse files
authored
Ran configlet sync --docs --update (#2560)
1 parent 94f7341 commit dbfbeae

File tree

36 files changed

+175
-88
lines changed

36 files changed

+175
-88
lines changed

exercises/practice/affine-cipher/.docs/instructions.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The affine cipher is a type of monoalphabetic substitution cipher.
66
Each character is mapped to its numeric equivalent, encrypted with a mathematical function and then converted to the letter relating to its new numeric value.
77
Although all monoalphabetic ciphers are weak, the affine cipher is much stronger than the atbash cipher, because it has many more keys.
88

9-
[//]: # ' monoalphabetic as spelled by Merriam-Webster, compare to polyalphabetic '
9+
[//]: # " monoalphabetic as spelled by Merriam-Webster, compare to polyalphabetic "
1010

1111
## Encryption
1212

@@ -18,10 +18,10 @@ E(x) = (ai + b) mod m
1818

1919
Where:
2020

21-
- `i` is the letter's index from `0` to the length of the alphabet - 1
21+
- `i` is the letter's index from `0` to the length of the alphabet - 1.
2222
- `m` is the length of the alphabet.
2323
For the Roman alphabet `m` is `26`.
24-
- `a` and `b` are integers which make the encryption key
24+
- `a` and `b` are integers which make up the encryption key.
2525

2626
Values `a` and `m` must be _coprime_ (or, _relatively prime_) for automatic decryption to succeed, i.e., they have number `1` as their only common factor (more information can be found in the [Wikipedia article about coprime integers][coprime-integers]).
2727
In case `a` is not coprime to `m`, your program should indicate that this is an error.

exercises/practice/alphametics/.docs/instructions.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Instructions
22

3-
Write a function to solve alphametics puzzles.
3+
Given an alphametics puzzle, find the correct solution.
44

55
[Alphametics][alphametics] is a puzzle where letters in words are replaced with numbers.
66

@@ -26,6 +26,4 @@ This is correct because every letter is replaced by a different number and the w
2626

2727
Each letter must represent a different digit, and the leading digit of a multi-digit number must not be zero.
2828

29-
Write a function to solve alphametics puzzles.
30-
3129
[alphametics]: https://en.wikipedia.org/wiki/Alphametics

exercises/practice/bank-account/.docs/instructions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Your task is to implement bank accounts supporting opening/closing, withdrawals, and deposits of money.
44

55
As bank accounts can be accessed in many different ways (internet, mobile phones, automatic charges), your bank software must allow accounts to be safely accessed from multiple threads/processes (terminology depends on your programming language) in parallel.
6-
For example, there may be many deposits and withdrawals occurring in parallel; you need to ensure there is no [race conditions][wikipedia] between when you read the account balance and set the new balance.
6+
For example, there may be many deposits and withdrawals occurring in parallel; you need to ensure there are no [race conditions][wikipedia] between when you read the account balance and set the new balance.
77

88
It should be possible to close an account; operations against a closed account must fail.
99

exercises/practice/binary-search/.docs/instructions.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ Your task is to implement a binary search algorithm.
55
A binary search algorithm finds an item in a list by repeatedly splitting it in half, only keeping the half which contains the item we're looking for.
66
It allows us to quickly narrow down the possible locations of our item until we find it, or until we've eliminated all possible locations.
77

8-
```exercism/caution
8+
~~~~exercism/caution
99
Binary search only works when a list has been sorted.
10-
```
10+
~~~~
1111

1212
The algorithm looks like this:
1313

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Instructions
22

3-
Write a function that returns the earned points in a single toss of a Darts game.
3+
Calculate the points scored in a single toss of a Darts game.
44

55
[Darts][darts] is a game where players throw darts at a [target][darts-target].
66

@@ -16,7 +16,7 @@ In our particular instance of the game, the target rewards 4 different amounts o
1616
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.
1717
Of course, they are all centered at the same point — that is, the circles are [concentric][] defined by the coordinates (0, 0).
1818

19-
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.
19+
Given a point in the target (defined by its [Cartesian coordinates][cartesian-coordinates] `x` and `y`, where `x` and `y` are [real][real-numbers]), calculate the correct score earned by a dart landing at that point.
2020

2121
## Credit
2222

exercises/practice/etl/.docs/instructions.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ This needs to be changed to store each individual letter with its score in a one
2222

2323
As part of this change, the team has also decided to change the letters to be lower-case rather than upper-case.
2424

25-
```exercism/note
25+
~~~~exercism/note
2626
If you want to look at how the data was previously structured and how it needs to change, take a look at the examples in the test suite.
27-
```
27+
~~~~

exercises/practice/flatten-array/.docs/instructions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Take a nested list and return a single flattened list with all values except nil/null.
44

5-
The challenge is to write a function that accepts an arbitrarily-deep nested list-like structure and returns a flattened structure without any nil/null values.
5+
The challenge is to take an arbitrarily-deep nested list-like structure and produce a flattened structure without any nil/null values.
66

77
For example:
88

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

+2-2
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/go-counting/.docs/instructions.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ Count the scored points on a Go board.
55
In the game of go (also known as baduk, igo, cờ vây and wéiqí) points are gained by completely encircling empty intersections with your stones.
66
The encircled intersections of a player are known as its territory.
77

8-
Write a function that determines the territory of each player.
8+
Calculate the territory of each player.
99
You may assume that any stones that have been stranded in enemy territory have already been taken off the board.
1010

11-
Write a function that determines the territory which includes a specified coordinate.
11+
Determine the territory which includes a specified coordinate.
1212

1313
Multiple empty intersections may be encircled at once and for encircling only horizontal and vertical neighbors count.
1414
In the following diagram the stones which matter are marked "O" and the stones that don't are marked "I" (ignored).
@@ -25,7 +25,7 @@ Empty spaces represent empty intersections.
2525

2626
To be more precise an empty intersection is part of a player's territory if all of its neighbors are either stones of that player or empty intersections that are part of that player's territory.
2727

28-
For more information see [wikipedia][go-wikipedia] or [Sensei's Library][go-sensei].
28+
For more information see [Wikipedia][go-wikipedia] or [Sensei's Library][go-sensei].
2929

3030
[go-wikipedia]: https://en.wikipedia.org/wiki/Go_%28game%29
3131
[go-sensei]: https://senseis.xmp.net/

exercises/practice/hamming/.docs/instructions.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Instructions
22

3-
Calculate the Hamming Distance between two DNA strands.
3+
Calculate the Hamming distance between two DNA strands.
44

55
Your body is made up of cells that contain DNA.
66
Those cells regularly wear out and need replacing, which they achieve by dividing into daughter cells.
@@ -9,18 +9,18 @@ In fact, the average human body experiences about 10 quadrillion cell divisions
99
When cells divide, their DNA replicates too.
1010
Sometimes during this process mistakes happen and single pieces of DNA get encoded with the incorrect information.
1111
If we compare two strands of DNA and count the differences between them we can see how many mistakes occurred.
12-
This is known as the "Hamming Distance".
12+
This is known as the "Hamming distance".
1313

14-
We read DNA using the letters C,A,G and T.
14+
We read DNA using the letters C, A, G and T.
1515
Two strands might look like this:
1616

1717
GAGCCTACTAACGGGAT
1818
CATCGTAATGACGGCCT
1919
^ ^ ^ ^ ^ ^^
2020

21-
They have 7 differences, and therefore the Hamming Distance is 7.
21+
They have 7 differences, and therefore the Hamming distance is 7.
2222

23-
The Hamming Distance is useful for lots of things in science, not just biology, so it's a nice phrase to be familiar with :)
23+
The Hamming distance is useful for lots of things in science, not just biology, so it's a nice phrase to be familiar with :)
2424

2525
## Implementation notes
2626

exercises/practice/leap/.docs/introduction.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ Some examples:
1111
- 1900 was not a leap year as it's not divisible by 400.
1212
- 2000 was a leap year!
1313

14-
```exercism/note
14+
~~~~exercism/note
1515
For a delightful, four-minute explanation of the whole phenomenon of leap years, check out [this YouTube video](https://www.youtube.com/watch?v=xX96xng7sAE).
16-
```
16+
~~~~

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

+2-2
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/luhn/.docs/instructions.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ The first step of the Luhn algorithm is to double every second digit, starting f
2222
We will be doubling
2323

2424
```text
25-
4_3_ 3_9_ 0_4_ 6_6_
25+
4539 3195 0343 6467
26+
↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ (double these)
2627
```
2728

2829
If doubling the number results in a number greater than 9 then subtract 9 from the product.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Instructions
22

33
Given a string containing brackets `[]`, braces `{}`, parentheses `()`, or any combination thereof, verify that any and all pairs are matched and nested correctly.
4-
The string may also contain other characters, which for the purposes of this exercise should be ignored.
4+
Any other characters should be ignored.
5+
For example, `"{what is (42)}?"` is balanced and `"[text}"` is not.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Introduction
2+
3+
You're given the opportunity to write software for the Bracketeer™, an ancient but powerful mainframe.
4+
The software that runs on it is written in a proprietary language.
5+
Much of its syntax is familiar, but you notice _lots_ of brackets, braces and parentheses.
6+
Despite the Bracketeer™ being powerful, it lacks flexibility.
7+
If the source code has any unbalanced brackets, braces or parentheses, the Bracketeer™ crashes and must be rebooted.
8+
To avoid such a scenario, you start writing code that can verify that brackets, braces, and parentheses are balanced before attempting to run it on the Bracketeer™.

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

+2-2
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ Count the frequency of letters in texts using parallel computation.
44

55
Parallelism is about doing things in parallel that can also be done sequentially.
66
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.
7+
Employ parallelism to calculate the total frequency of each letter in a list of texts.
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,35 @@
11
# Instructions
22

3-
Compute Pascal's triangle up to a given number of rows.
3+
Your task is to output the first N rows of Pascal's triangle.
44

5-
In Pascal's Triangle each number is computed by adding the numbers to the right and left of the current position in the previous row.
5+
[Pascal's triangle][wikipedia] is a triangular array of positive integers.
6+
7+
In Pascal's triangle, the number of values in a row is equal to its row number (which starts at one).
8+
Therefore, the first row has one value, the second row has two values, and so on.
9+
10+
The first (topmost) row has a single value: `1`.
11+
Subsequent rows' values are computed by adding the numbers directly to the right and left of the current position in the previous row.
12+
13+
If the previous row does _not_ have a value to the left or right of the current position (which only happens for the leftmost and rightmost positions), treat that position's value as zero (effectively "ignoring" it in the summation).
14+
15+
## Example
16+
17+
Let's look at the first 5 rows of Pascal's Triangle:
618

719
```text
820
1
921
1 1
1022
1 2 1
1123
1 3 3 1
1224
1 4 6 4 1
13-
# ... etc
1425
```
26+
27+
The topmost row has one value, which is `1`.
28+
29+
The leftmost and rightmost values have only one preceding position to consider, which is the position to its right respectively to its left.
30+
With the topmost value being `1`, it follows from this that all the leftmost and rightmost values are also `1`.
31+
32+
The other values all have two positions to consider.
33+
For example, the fifth row's (`1 4 6 4 1`) middle value is `6`, as the values to its left and right in the preceding row are `3` and `3`:
34+
35+
[wikipedia]: https://en.wikipedia.org/wiki/Pascal%27s_triangle
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Introduction
2+
3+
With the weather being great, you're not looking forward to spending an hour in a classroom.
4+
Annoyed, you enter the class room, where you notice a strangely satisfying triangle shape on the blackboard.
5+
Whilst waiting for your math teacher to arrive, you can't help but notice some patterns in the triangle: the outer values are all ones, each subsequent row has one more value than its previous row and the triangle is symmetrical.
6+
Weird!
7+
8+
Not long after you sit down, your teacher enters the room and explains that this triangle is the famous [Pascal's triangle][wikipedia].
9+
10+
Over the next hour, your teacher reveals some amazing things hidden in this triangle:
11+
12+
- It can be used to compute how many ways you can pick K elements from N values.
13+
- It contains the Fibonacci sequence.
14+
- If you color odd and even numbers differently, you get a beautiful pattern called the [Sierpiński triangle][wikipedia-sierpinski-triangle].
15+
16+
The teacher implores you and your classmates to lookup other uses, and assures you that there are lots more!
17+
At that moment, the school bell rings.
18+
You realize that for the past hour, you were completely absorbed in learning about Pascal's triangle.
19+
You quickly grab your laptop from your bag and go outside, ready to enjoy both the sunshine _and_ the wonders of Pascal's triangle.
20+
21+
[wikipedia]: https://en.wikipedia.org/wiki/Pascal%27s_triangle
22+
[wikipedia-sierpinski-triangle]: https://en.wikipedia.org/wiki/Sierpi%C5%84ski_triangle

exercises/practice/pig-latin/.docs/instructions.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ For example:
1919

2020
## Rule 2
2121

22-
If a word begins with a one or more consonants, first move those consonants to the end of the word and then add an `"ay"` sound to the end of the word.
22+
If a word begins with one or more consonants, first move those consonants to the end of the word and then add an `"ay"` sound to the end of the word.
2323

2424
For example:
2525

@@ -33,7 +33,7 @@ If a word starts with zero or more consonants followed by `"qu"`, first move tho
3333

3434
For example:
3535

36-
- `"quick"` -> `"ickqu"` -> `"ay"` (starts with `"qu"`, no preceding consonants)
36+
- `"quick"` -> `"ickqu"` -> `"ickquay"` (starts with `"qu"`, no preceding consonants)
3737
- `"square"` -> `"aresqu"` -> `"aresquay"` (starts with one consonant followed by `"qu`")
3838

3939
## Rule 4

exercises/practice/poker/.docs/instructions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
Pick the best hand(s) from a list of poker hands.
44

5-
See [wikipedia][poker-hands] for an overview of poker hands.
5+
See [Wikipedia][poker-hands] for an overview of poker hands.
66

77
[poker-hands]: https://en.wikipedia.org/wiki/List_of_poker_hands

exercises/practice/rational-numbers/.docs/instructions.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
A rational number is defined as the quotient of two integers `a` and `b`, called the numerator and denominator, respectively, where `b != 0`.
44

5-
```exercism/note
5+
~~~~exercism/note
66
Note that mathematically, the denominator can't be zero.
77
However in many implementations of rational numbers, you will find that the denominator is allowed to be zero with behaviour similar to positive or negative infinity in floating point numbers.
88
In those cases, the denominator and numerator generally still can't both be zero at once.
9-
```
9+
~~~~
1010

1111
The absolute value `|r|` of the rational number `r = a/b` is equal to `|a|/|b|`.
1212

Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Instructions
22

3-
Your task is determine the RNA complement of a given DNA sequence.
3+
Your task is to determine the RNA complement of a given DNA sequence.
44

55
Both DNA and RNA strands are a sequence of nucleotides.
66

7-
The four nucleotides found in DNA are adenine (**A**), cytosine (**C**), guanine (**G**) and thymine (**T**).
7+
The four nucleotides found in DNA are adenine (**A**), cytosine (**C**), guanine (**G**), and thymine (**T**).
88

9-
The four nucleotides found in RNA are adenine (**A**), cytosine (**C**), guanine (**G**) and uracil (**U**).
9+
The four nucleotides found in RNA are adenine (**A**), cytosine (**C**), guanine (**G**), and uracil (**U**).
1010

1111
Given a DNA strand, its transcribed RNA strand is formed by replacing each nucleotide with its complement:
1212

@@ -15,6 +15,6 @@ Given a DNA strand, its transcribed RNA strand is formed by replacing each nucle
1515
- `T` -> `A`
1616
- `A` -> `U`
1717

18-
```exercism/note
18+
~~~~exercism/note
1919
If you want to look at how the inputs and outputs are structured, take a look at the examples in the test suite.
20-
```
20+
~~~~

exercises/practice/rna-transcription/.docs/introduction.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ You work for a bioengineering company that specializes in developing therapeutic
44

55
Your team has just been given a new project to develop a targeted therapy for a rare type of cancer.
66

7-
```exercism/note
7+
~~~~exercism/note
88
It's all very complicated, but the basic idea is that sometimes people's bodies produce too much of a given protein.
99
That can cause all sorts of havoc.
1010
@@ -13,4 +13,4 @@ But if you can create a very specific molecule (called a micro-RNA), it can prev
1313
This technique is called [RNA Interference][rnai].
1414
1515
[rnai]: https://admin.acceleratingscience.com/ask-a-scientist/what-is-rnai/
16-
```
16+
~~~~

exercises/practice/say/.docs/instructions.md

-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ Implement breaking a number up into chunks of thousands.
3030

3131
So `1234567890` should yield a list like 1, 234, 567, and 890, while the far simpler `1000` should yield just 1 and 0.
3232

33-
The program must also report any values that are out of range.
34-
3533
## Step 3
3634

3735
Now handle inserting the appropriate scale word between those chunks.

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ The secret handshake for 26 is therefore:
4141
jump, double blink
4242
```
4343

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

0 commit comments

Comments
 (0)