Skip to content

Commit 8da3340

Browse files
Sync exercise instructions (#529)
1 parent 08bb30c commit 8da3340

File tree

11 files changed

+51
-17
lines changed

11 files changed

+51
-17
lines changed

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
".meta/example.lua"
1717
]
1818
},
19-
"blurb": "Create an implementation of the atbash cipher, an ancient encryption system created in the Middle East.",
19+
"blurb": "Create an implementation of the Atbash cipher, an ancient encryption system created in the Middle East.",
2020
"source": "Wikipedia",
2121
"source_url": "https://en.wikipedia.org/wiki/Atbash"
2222
}

exercises/practice/pov/.meta/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
},
1616
"blurb": "Reparent a graph on a selected node.",
1717
"source": "Adaptation of exercise from 4clojure",
18-
"source_url": "https://www.4clojure.com/"
18+
"source_url": "https://github.com/oxalorg/4ever-clojure"
1919
}

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 19 additions & 0 deletions
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
".meta/example.lua"
1717
]
1818
},
19-
"blurb": "There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the triplet.",
20-
"source": "Problem 9 at Project Euler",
19+
"blurb": "Given an integer N, find all Pythagorean triplets for which a + b + c = N.",
20+
"source": "A variation of Problem 9 from Project Euler",
2121
"source_url": "https://projecteuler.net/problem=9"
2222
}

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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 11 additions & 6 deletions
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
Lines changed: 10 additions & 0 deletions
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)