Skip to content

Commit cd1f419

Browse files
committed
Sync docs and metadata
1 parent 5b9cfe3 commit cd1f419

File tree

15 files changed

+116
-61
lines changed

15 files changed

+116
-61
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Create an implementation of the affine cipher, an ancient encryption system crea
44

55
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.
7-
Although all monoalphabetic ciphers are weak, the affine cipher is much stronger than the atbash cipher, because it has many more keys.
7+
Although all monoalphabetic ciphers are weak, the affine cipher is much stronger than the Atbash cipher, because it has many more keys.
88

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

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

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

3-
Create an implementation of the atbash cipher, an ancient encryption system created in the Middle East.
3+
Create an implementation of the Atbash cipher, an ancient encryption system created in the Middle East.
44

55
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.
66
The first letter is replaced with the last letter, the second with the second-last, and so on.

exercises/practice/atbash-cipher/.meta/config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"example/atbash_cipher.d"
1414
]
1515
},
16-
"blurb": "Create an implementation of the atbash cipher, an ancient encryption system created in the Middle East.",
16+
"blurb": "Create an implementation of the Atbash cipher, an ancient encryption system created in the Middle East.",
1717
"source": "Wikipedia",
1818
"source_url": "https://en.wikipedia.org/wiki/Atbash"
1919
}

exercises/practice/eliuds-eggs/.docs/introduction.md

+33-15
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,54 @@ The position information encoding is calculated as follows:
1212
2. Convert the number from binary to decimal.
1313
3. Show the result on the display.
1414

15-
Example 1:
15+
## Example 1
16+
17+
![Seven individual nest boxes arranged in a row whose first, third, fourth and seventh nests each have a single egg.](https://assets.exercism.org/images/exercises/eliuds-eggs/example-1-coop.svg)
1618

1719
```text
18-
Chicken Coop:
1920
_ _ _ _ _ _ _
2021
|E| |E|E| | |E|
22+
```
23+
24+
### Resulting Binary
25+
26+
![1011001](https://assets.exercism.org/images/exercises/eliuds-eggs/example-1-binary.svg)
27+
28+
```text
29+
_ _ _ _ _ _ _
30+
|1|0|1|1|0|0|1|
31+
```
2132

22-
Resulting Binary:
23-
1 0 1 1 0 0 1
33+
### Decimal number on the display
2434

25-
Decimal number on the display:
2635
89
2736

28-
Actual eggs in the coop:
37+
### Actual eggs in the coop
38+
2939
4
40+
41+
## Example 2
42+
43+
![Seven individual nest boxes arranged in a row where only the fourth nest has an egg.](https://assets.exercism.org/images/exercises/eliuds-eggs/example-2-coop.svg)
44+
45+
```text
46+
_ _ _ _ _ _ _
47+
| | | |E| | | |
3048
```
3149

32-
Example 2:
50+
### Resulting Binary
51+
52+
![0001000](https://assets.exercism.org/images/exercises/eliuds-eggs/example-2-binary.svg)
3353

3454
```text
35-
Chicken Coop:
36-
_ _ _ _ _ _ _ _
37-
| | | |E| | | | |
55+
_ _ _ _ _ _ _
56+
|0|0|0|1|0|0|0|
57+
```
3858

39-
Resulting Binary:
40-
0 0 0 1 0 0 0 0
59+
### Decimal number on the display
4160

42-
Decimal number on the display:
4361
16
4462

45-
Actual eggs in the coop:
63+
### Actual eggs in the coop
64+
4665
1
47-
```
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# Instructions
22

3-
Given students' names along with the grade that they are in, create a roster for the school.
3+
Given students' names along with the grade they are in, create a roster for the school.
44

55
In the end, you should be able to:
66

7-
- Add a student's name to the roster for a grade
7+
- Add a student's name to the roster for a grade:
88
- "Add Jim to grade 2."
99
- "OK."
10-
- Get a list of all students enrolled in a grade
10+
- Get a list of all students enrolled in a grade:
1111
- "Which students are in grade 2?"
12-
- "We've only got Jim just now."
12+
- "We've only got Jim right now."
1313
- Get a sorted list of all students in all grades.
14-
Grades should sort as 1, 2, 3, etc., and students within a grade should be sorted alphabetically by name.
15-
- "Who all is enrolled in school right now?"
14+
Grades should be sorted as 1, 2, 3, etc., and students within a grade should be sorted alphabetically by name.
15+
- "Who is enrolled in school right now?"
1616
- "Let me think.
17-
We have Anna, Barb, and Charlie in grade 1, Alex, Peter, and Zoe in grade 2 and Jim in grade 5.
18-
So the answer is: Anna, Barb, Charlie, Alex, Peter, Zoe and Jim"
17+
We have Anna, Barb, and Charlie in grade 1, Alex, Peter, and Zoe in grade 2, and Jim in grade 5.
18+
So the answer is: Anna, Barb, Charlie, Alex, Peter, Zoe, and Jim."
1919

20-
Note that all our students only have one name (It's a small town, what do you want?) and each student cannot be added more than once to a grade or the roster.
21-
In fact, when a test attempts to add the same student more than once, your implementation should indicate that this is incorrect.
20+
Note that all our students only have one name (it's a small town, what do you want?), and each student cannot be added more than once to a grade or the roster.
21+
If a test attempts to add the same student more than once, your implementation should indicate that this is incorrect.

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

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

33
Calculate the Hamming distance between two DNA strands.
44

5-
Your body is made up of cells that contain DNA.
6-
Those cells regularly wear out and need replacing, which they achieve by dividing into daughter cells.
7-
In fact, the average human body experiences about 10 quadrillion cell divisions in a lifetime!
8-
9-
When cells divide, their DNA replicates too.
10-
Sometimes during this process mistakes happen and single pieces of DNA get encoded with the incorrect information.
11-
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".
13-
145
We read DNA using the letters C, A, G and T.
156
Two strands might look like this:
167

@@ -20,8 +11,6 @@ Two strands might look like this:
2011

2112
They have 7 differences, and therefore the Hamming distance is 7.
2213

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 :)
24-
2514
## Implementation notes
2615

2716
The Hamming distance is only defined for sequences of equal length, so an attempt to calculate it between sequences of different lengths should not work.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Introduction
2+
3+
Your body is made up of cells that contain DNA.
4+
Those cells regularly wear out and need replacing, which they achieve by dividing into daughter cells.
5+
In fact, the average human body experiences about 10 quadrillion cell divisions in a lifetime!
6+
7+
When cells divide, their DNA replicates too.
8+
Sometimes during this process mistakes happen and single pieces of DNA get encoded with the incorrect information.
9+
If we compare two strands of DNA and count the differences between them, we can see how many mistakes occurred.
10+
This is known as the "Hamming distance".
11+
12+
The Hamming distance is useful in many areas of science, not just biology, so it's a nice phrase to be familiar with :)

exercises/practice/knapsack/.docs/instructions.md

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

3-
Your task is to determine which items to take so that the total value of his selection is maximized, taking into account the knapsack's carrying capacity.
3+
Your task is to determine which items to take so that the total value of her selection is maximized, taking into account the knapsack's carrying capacity.
44

55
Items will be represented as a list of items.
66
Each item will have a weight and value.
77
All values given will be strictly positive.
8-
Bob can take only one of each item.
8+
Lhakpa can take only one of each item.
99

1010
For example:
1111

@@ -21,5 +21,5 @@ Knapsack Maximum Weight: 10
2121
```
2222

2323
For the above, the first item has weight 5 and value 10, the second item has weight 4 and value 40, and so on.
24-
In this example, Bob should take the second and fourth item to maximize his value, which, in this case, is 90.
25-
He cannot get more than 90 as his knapsack has a weight limit of 10.
24+
In this example, Lhakpa should take the second and fourth item to maximize her value, which, in this case, is 90.
25+
She cannot get more than 90 as her knapsack has a weight limit of 10.
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Introduction
22

3-
Bob is a thief.
4-
After months of careful planning, he finally manages to crack the security systems of a fancy store.
3+
Lhakpa is a [Sherpa][sherpa] mountain guide and porter.
4+
After months of careful planning, the expedition Lhakpa works for is about to leave.
5+
She will be paid the value she carried to the base camp.
56

6-
In front of him are many items, each with a value and weight.
7-
Bob would gladly take all of the items, but his knapsack can only hold so much weight.
8-
Bob has to carefully consider which items to take so that the total value of his selection is maximized.
7+
In front of her are many items, each with a value and weight.
8+
Lhakpa would gladly take all of the items, but her knapsack can only hold so much weight.
9+
10+
[sherpa]: https://en.wikipedia.org/wiki/Sherpa_people#Mountaineering

exercises/practice/protein-translation/.docs/instructions.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
Translate RNA sequences into proteins.
44

5-
RNA can be broken into three nucleotide sequences called codons, and then translated to a polypeptide like so:
5+
RNA can be broken into three-nucleotide sequences called codons, and then translated to a protein like so:
66

77
RNA: `"AUGUUUUCU"` => translates to
88

99
Codons: `"AUG", "UUU", "UCU"`
10-
=> which become a polypeptide with the following sequence =>
10+
=> which become a protein with the following sequence =>
1111

1212
Protein: `"Methionine", "Phenylalanine", "Serine"`
1313

@@ -27,9 +27,9 @@ Protein: `"Methionine", "Phenylalanine", "Serine"`
2727

2828
Note the stop codon `"UAA"` terminates the translation and the final methionine is not translated into the protein sequence.
2929

30-
Below are the codons and resulting Amino Acids needed for the exercise.
30+
Below are the codons and resulting amino acids needed for the exercise.
3131

32-
| Codon | Protein |
32+
| Codon | Amino Acid |
3333
| :----------------- | :------------ |
3434
| AUG | Methionine |
3535
| UUU, UUC | Phenylalanine |

exercises/practice/pythagorean-triplet/.docs/instructions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Instructions
1+
# Description
22

33
A Pythagorean triplet is a set of three natural numbers, {a, b, c}, for which,
44

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Introduction
2+
3+
You are an accomplished problem-solver, known for your ability to tackle the most challenging mathematical puzzles.
4+
One evening, you receive an urgent letter from an inventor called the Triangle Tinkerer, who is working on a groundbreaking new project.
5+
The letter reads:
6+
7+
> Dear Mathematician,
8+
>
9+
> I need your help.
10+
> I am designing a device that relies on the unique properties of Pythagorean triplets — sets of three integers that satisfy the equation a² + b² = c².
11+
> This device will revolutionize navigation, but for it to work, I must program it with every possible triplet where the sum of a, b, and c equals a specific number, N.
12+
> Calculating these triplets by hand would take me years, but I hear you are more than up to the task.
13+
>
14+
> Time is of the essence.
15+
> The future of my invention — and perhaps even the future of mathematical innovation — rests on your ability to solve this problem.
16+
17+
Motivated by the importance of the task, you set out to find all Pythagorean triplets that satisfy the condition.
18+
Your work could have far-reaching implications, unlocking new possibilities in science and engineering.
19+
Can you rise to the challenge and make history?

exercises/practice/pythagorean-triplet/.meta/config.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"example/pythagorean_triplet.d"
1414
]
1515
},
16-
"blurb": "There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the triplet.",
17-
"source": "Problem 9 at Project Euler",
16+
"blurb": "Given an integer N, find all Pythagorean triplets for which a + b + c = N.",
17+
"source": "A variation of Problem 9 from Project Euler",
1818
"source_url": "https://projecteuler.net/problem=9"
1919
}
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
# Instructions
22

3-
Given a natural radicand, return its square root.
3+
Your task is to calculate the square root of a given number.
44

5-
Note that the term "radicand" refers to the number for which the root is to be determined.
6-
That is, it is the number under the root symbol.
5+
- Try to avoid using the pre-existing math libraries of your language.
6+
- As input you'll be given a positive whole number, i.e. 1, 2, 3, 4…
7+
- You are only required to handle cases where the result is a positive whole number.
78

8-
Check out the Wikipedia pages on [square root][square-root] and [methods of computing square roots][computing-square-roots].
9+
Some potential approaches:
910

10-
Recall also that natural numbers are positive real whole numbers (i.e. 1, 2, 3 and up).
11+
- Linear or binary search for a number that gives the input number when squared.
12+
- Successive approximation using Newton's or Heron's method.
13+
- Calculating one digit at a time or one bit at a time.
1114

12-
[square-root]: https://en.wikipedia.org/wiki/Square_root
15+
You can check out the Wikipedia pages on [integer square root][integer-square-root] and [methods of computing square roots][computing-square-roots] to help with choosing a method of calculation.
16+
17+
[integer-square-root]: https://en.wikipedia.org/wiki/Integer_square_root
1318
[computing-square-roots]: https://en.wikipedia.org/wiki/Methods_of_computing_square_roots
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Introduction
2+
3+
We are launching a deep space exploration rocket and we need a way to make sure the navigation system stays on target.
4+
5+
As the first step in our calculation, we take a target number and find its square root (that is, the number that when multiplied by itself equals the target number).
6+
7+
The journey will be very long.
8+
To make the batteries last as long as possible, we had to make our rocket's onboard computer very power efficient.
9+
Unfortunately that means that we can't rely on fancy math libraries and functions, as they use more power.
10+
Instead we want to implement our own square root calculation.

0 commit comments

Comments
 (0)