Skip to content

Commit

Permalink
Sync docs and metadata (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
BNAndras authored Dec 6, 2024
1 parent 10ba2ea commit ea5f1ee
Show file tree
Hide file tree
Showing 20 changed files with 118 additions and 75 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 @@ -13,7 +13,7 @@
".meta/Example.hx"
]
},
"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"
}
4 changes: 2 additions & 2 deletions exercises/practice/darts/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Instructions

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

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

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

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

## Credit

Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/darts/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
".meta/Example.hx"
]
},
"blurb": "Write a function that returns the earned points in a single toss of a Darts game.",
"blurb": "Calculate the points scored in a single toss of a Darts game.",
"source": "Inspired by an exercise created by a professor Della Paolera in Argentina"
}
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
```
2 changes: 1 addition & 1 deletion exercises/practice/flatten-array/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

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.
The challenge is to take an arbitrarily-deep nested list-like structure and produce a flattened structure without any nil/null values.

For example:

Expand Down
20 changes: 10 additions & 10 deletions exercises/practice/grade-school/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Instructions

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

In the end, you should be able to:

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

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.
In fact, when a test attempts to add the same student more than once, your implementation should indicate that this is incorrect.
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.
If a test attempts to add the same student more than once, your implementation should indicate that this is incorrect.
17 changes: 3 additions & 14 deletions exercises/practice/hamming/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
# Instructions

Calculate the Hamming Distance between two DNA strands.
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.
We read DNA using the letters C, A, G and T.
Two strands might look like this:

GAGCCTACTAACGGGAT
CATCGTAATGACGGCCT
^ ^ ^ ^ ^ ^^

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 :)
They have 7 differences, and therefore the Hamming distance is 7.

## Implementation notes

Expand Down
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 @@ -16,7 +16,7 @@
".meta/Example.hx"
]
},
"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/"
}
3 changes: 2 additions & 1 deletion exercises/practice/luhn/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ The first step of the Luhn algorithm is to double every second digit, starting f
We will be doubling

```text
4_3_ 3_9_ 0_4_ 6_6_
4539 3195 0343 6467
↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ (double these)
```

If doubling the number results in a number greater than 9 then subtract 9 from the product.
Expand Down
4 changes: 2 additions & 2 deletions exercises/practice/pig-latin/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ For example:

## Rule 2

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

For example:

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

For example:

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

## Rule 4
Expand Down
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
2 changes: 1 addition & 1 deletion exercises/practice/raindrops/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
".meta/Example.hx"
]
},
"blurb": "Convert a number to a string, the content of which depends on the number's factors.",
"blurb": "Convert a number into its corresponding raindrop sounds - Pling, Plang and Plong.",
"source": "A variation on FizzBuzz, a famous technical interview question that is intended to weed out potential candidates. That question is itself derived from Fizz Buzz, a popular children's game for teaching division.",
"source_url": "https://en.wikipedia.org/wiki/Fizz_buzz"
}
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
31 changes: 17 additions & 14 deletions exercises/practice/space-age/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
# Instructions

Given an age in seconds, calculate how old someone would be on:
Given an age in seconds, calculate how old someone would be on a planet in our Solar System.

- Mercury: orbital period 0.2408467 Earth years
- Venus: orbital period 0.61519726 Earth years
- Earth: orbital period 1.0 Earth years, 365.25 Earth days, or 31557600 seconds
- Mars: orbital period 1.8808158 Earth years
- Jupiter: orbital period 11.862615 Earth years
- Saturn: orbital period 29.447498 Earth years
- Uranus: orbital period 84.016846 Earth years
- Neptune: orbital period 164.79132 Earth years
One Earth year equals 365.25 Earth days, or 31,557,600 seconds.
If you were told someone was 1,000,000,000 seconds old, their age would be 31.69 Earth-years.

So if you were told someone were 1,000,000,000 seconds old, you should
be able to say that they're 31.69 Earth-years old.
For the other planets, you have to account for their orbital period in Earth Years:

If you're wondering why Pluto didn't make the cut, go watch [this YouTube video][pluto-video].
| Planet | Orbital period in Earth Years |
| ------- | ----------------------------- |
| Mercury | 0.2408467 |
| Venus | 0.61519726 |
| Earth | 1.0 |
| Mars | 1.8808158 |
| Jupiter | 11.862615 |
| Saturn | 29.447498 |
| Uranus | 84.016846 |
| Neptune | 164.79132 |

Note: The actual length of one complete orbit of the Earth around the sun is closer to 365.256 days (1 sidereal year).
~~~~exercism/note
The actual length of one complete orbit of the Earth around the sun is closer to 365.256 days (1 sidereal year).
The Gregorian calendar has, on average, 365.2425 days.
While not entirely accurate, 365.25 is the value used in this exercise.
See [Year on Wikipedia][year] for more ways to measure a year.
[pluto-video]: https://www.youtube.com/watch?v=Z_2gbGXzFbs
[year]: https://en.wikipedia.org/wiki/Year#Summary
~~~~
20 changes: 20 additions & 0 deletions exercises/practice/space-age/.docs/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Introduction

The year is 2525 and you've just embarked on a journey to visit all planets in the Solar System (Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus and Neptune).
The first stop is Mercury, where customs require you to fill out a form (bureaucracy is apparently _not_ Earth-specific).
As you hand over the form to the customs officer, they scrutinize it and frown.
"Do you _really_ expect me to believe you're just 50 years old?
You must be closer to 200 years old!"

Amused, you wait for the customs officer to start laughing, but they appear to be dead serious.
You realize that you've entered your age in _Earth years_, but the officer expected it in _Mercury years_!
As Mercury's orbital period around the sun is significantly shorter than Earth, you're actually a lot older in Mercury years.
After some quick calculations, you're able to provide your age in Mercury Years.
The customs officer smiles, satisfied, and waves you through.
You make a mental note to pre-calculate your planet-specific age _before_ future customs checks, to avoid such mix-ups.

~~~~exercism/note
If you're wondering why Pluto didn't make the cut, go watch [this YouTube video][pluto-video].
[pluto-video]: https://www.youtube.com/watch?v=Z_2gbGXzFbs
~~~~
2 changes: 1 addition & 1 deletion exercises/practice/strain/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
".meta/Example.hx"
]
},
"blurb": "Implement the `keep` and `discard` operation on collections. 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.",
"blurb": "Implement the `keep` and `discard` operation on collections.",
"source": "Conversation with James Edward Gray II",
"source_url": "http://graysoftinc.com/"
}
4 changes: 2 additions & 2 deletions exercises/practice/sublist/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Given any two lists `A` and `B`, determine if:
- None of the above is true, thus lists `A` and `B` are unequal

Specifically, list `A` is equal to list `B` if both lists have the same values in the same order.
List `A` is a superlist of `B` if `A` contains a sub-sequence of values equal to `B`.
List `A` is a sublist of `B` if `B` contains a sub-sequence of values equal to `A`.
List `A` is a superlist of `B` if `A` contains a contiguous sub-sequence of values equal to `B`.
List `A` is a sublist of `B` if `B` contains a contiguous sub-sequence of values equal to `A`.

Examples:

Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/yacht/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
]
},
"blurb": "Score a single throw of dice in the game Yacht.",
"source": "James Kilfiger, using wikipedia",
"source": "James Kilfiger, using Wikipedia",
"source_url": "https://en.wikipedia.org/wiki/Yacht_(dice_game)"
}

0 comments on commit ea5f1ee

Please sign in to comment.