Skip to content

Commit

Permalink
Sync docs and metadata (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
BNAndras authored Dec 8, 2024
1 parent b4b5b6e commit b605944
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 42 deletions.
2 changes: 1 addition & 1 deletion exercises/practice/atbash-cipher/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Instructions

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

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.
The first letter is replaced with the last letter, the second with the second-last, and so on.
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/atbash-cipher/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
".meta/ExampleTest.cfc"
]
},
"blurb": "Create an implementation of the atbash cipher, an ancient encryption system created in the Middle East.",
"blurb": "Create an implementation of the Atbash cipher, an ancient encryption system created in the Middle East.",
"source": "Wikipedia",
"source_url": "https://en.wikipedia.org/wiki/Atbash"
}
48 changes: 33 additions & 15 deletions exercises/practice/eliuds-eggs/.docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,54 @@ The position information encoding is calculated as follows:
2. Convert the number from binary to decimal.
3. Show the result on the display.

Example 1:
## Example 1

![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)

```text
Chicken Coop:
_ _ _ _ _ _ _
|E| |E|E| | |E|
```

### Resulting Binary

![1011001](https://assets.exercism.org/images/exercises/eliuds-eggs/example-1-binary.svg)

```text
_ _ _ _ _ _ _
|1|0|1|1|0|0|1|
```

Resulting Binary:
1 0 1 1 0 0 1
### Decimal number on the display

Decimal number on the display:
89

Actual eggs in the coop:
### Actual eggs in the coop

4

## Example 2

![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)

```text
_ _ _ _ _ _ _
| | | |E| | | |
```

Example 2:
### Resulting Binary

![0001000](https://assets.exercism.org/images/exercises/eliuds-eggs/example-2-binary.svg)

```text
Chicken Coop:
_ _ _ _ _ _ _ _
| | | |E| | | | |
_ _ _ _ _ _ _
|0|0|0|1|0|0|0|
```

Resulting Binary:
0 0 0 1 0 0 0 0
### Decimal number on the display

Decimal number on the display:
16

Actual eggs in the coop:
### Actual eggs in the coop

1
```
11 changes: 0 additions & 11 deletions exercises/practice/hamming/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@

Calculate the Hamming distance between two DNA strands.

Your body is made up of cells that contain DNA.
Those cells regularly wear out and need replacing, which they achieve by dividing into daughter cells.
In fact, the average human body experiences about 10 quadrillion cell divisions in a lifetime!

When cells divide, their DNA replicates too.
Sometimes during this process mistakes happen and single pieces of DNA get encoded with the incorrect information.
If we compare two strands of DNA and count the differences between them we can see how many mistakes occurred.
This is known as the "Hamming distance".

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

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

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

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

## Implementation notes

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.
12 changes: 12 additions & 0 deletions exercises/practice/hamming/.docs/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Introduction

Your body is made up of cells that contain DNA.
Those cells regularly wear out and need replacing, which they achieve by dividing into daughter cells.
In fact, the average human body experiences about 10 quadrillion cell divisions in a lifetime!

When cells divide, their DNA replicates too.
Sometimes during this process mistakes happen and single pieces of DNA get encoded with the incorrect information.
If we compare two strands of DNA and count the differences between them, we can see how many mistakes occurred.
This is known as the "Hamming distance".

The Hamming distance is useful in many areas of science, not just biology, so it's a nice phrase to be familiar with :)
2 changes: 1 addition & 1 deletion exercises/practice/hamming/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
".meta/ExampleTest.cfc"
]
},
"blurb": "Calculate the Hamming difference between two DNA strands.",
"blurb": "Calculate the Hamming distance between two DNA strands.",
"source": "The Calculating Point Mutations problem at Rosalind",
"source_url": "https://rosalind.info/problems/hamm/"
}
8 changes: 4 additions & 4 deletions exercises/practice/protein-translation/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

Translate RNA sequences into proteins.

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

RNA: `"AUGUUUUCU"` => translates to

Codons: `"AUG", "UUU", "UCU"`
=> which become a polypeptide with the following sequence =>
=> which become a protein with the following sequence =>

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

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

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

Below are the codons and resulting Amino Acids needed for the exercise.
Below are the codons and resulting amino acids needed for the exercise.

| Codon | Protein |
| Codon | Amino Acid |
| :----------------- | :------------ |
| AUG | Methionine |
| UUU, UUC | Phenylalanine |
Expand Down
6 changes: 3 additions & 3 deletions exercises/practice/rna-transcription/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Instructions

Your task is determine the RNA complement of a given DNA sequence.
Your task is to determine the RNA complement of a given DNA sequence.

Both DNA and RNA strands are a sequence of nucleotides.

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

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

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

Expand Down
17 changes: 11 additions & 6 deletions exercises/practice/square-root/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# Instructions

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

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

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

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

[square-root]: https://en.wikipedia.org/wiki/Square_root
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.

[integer-square-root]: https://en.wikipedia.org/wiki/Integer_square_root
[computing-square-roots]: https://en.wikipedia.org/wiki/Methods_of_computing_square_roots
10 changes: 10 additions & 0 deletions exercises/practice/square-root/.docs/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Introduction

We are launching a deep space exploration rocket and we need a way to make sure the navigation system stays on target.

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).

The journey will be very long.
To make the batteries last as long as possible, we had to make our rocket's onboard computer very power efficient.
Unfortunately that means that we can't rely on fancy math libraries and functions, as they use more power.
Instead we want to implement our own square root calculation.

0 comments on commit b605944

Please sign in to comment.