Skip to content

Commit

Permalink
Sync docs, files, and metadata (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
BNAndras authored Jan 2, 2025
1 parent 95fb598 commit 1dba666
Show file tree
Hide file tree
Showing 16 changed files with 111 additions and 57 deletions.
3 changes: 3 additions & 0 deletions exercises/practice/acronym/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
],
"example": [
".meta/src/example.art"
],
"invalidator": [
"tester.art"
]
},
"blurb": "Convert a long phrase to its acronym.",
Expand Down
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 @@ -16,7 +16,7 @@
"tester.art"
]
},
"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"
}
3 changes: 3 additions & 0 deletions exercises/practice/clock/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
],
"example": [
".meta/src/example.art"
],
"invalidator": [
"tester.art"
]
},
"blurb": "Implement a clock that handles times without dates.",
Expand Down
28 changes: 1 addition & 27 deletions exercises/practice/collatz-conjecture/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,3 @@
# Instructions

The Collatz Conjecture or 3x+1 problem can be summarized as follows:

Take any positive integer n.
If n is even, divide n by 2 to get n / 2.
If n is odd, multiply n by 3 and add 1 to get 3n + 1.
Repeat the process indefinitely.
The conjecture states that no matter which number you start with, you will always reach 1 eventually.

Given a number n, return the number of steps required to reach 1.

## Examples

Starting with n = 12, the steps would be as follows:

0. 12
1. 6
2. 3
3. 10
4. 5
5. 16
6. 8
7. 4
8. 2
9. 1

Resulting in 9 steps.
So for input n = 12, the return value would be 9.
Given a positive integer, return the number of steps it takes to reach 1 according to the rules of the Collatz Conjecture.
28 changes: 28 additions & 0 deletions exercises/practice/collatz-conjecture/.docs/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Introduction

One evening, you stumbled upon an old notebook filled with cryptic scribbles, as though someone had been obsessively chasing an idea.
On one page, a single question stood out: **Can every number find its way to 1?**
It was tied to something called the **Collatz Conjecture**, a puzzle that has baffled thinkers for decades.

The rules were deceptively simple.
Pick any positive integer.

- If it's even, divide it by 2.
- If it's odd, multiply it by 3 and add 1.

Then, repeat these steps with the result, continuing indefinitely.

Curious, you picked number 12 to test and began the journey:

12 ➜ 6 ➜ 3 ➜ 10 ➜ 5 ➜ 16 ➜ 8 ➜ 4 ➜ 2 ➜ 1

Counting from the second number (6), it took 9 steps to reach 1, and each time the rules repeated, the number kept changing.
At first, the sequence seemed unpredictable — jumping up, down, and all over.
Yet, the conjecture claims that no matter the starting number, we'll always end at 1.

It was fascinating, but also puzzling.
Why does this always seem to work?
Could there be a number where the process breaks down, looping forever or escaping into infinity?
The notebook suggested solving this could reveal something profound — and with it, fame, [fortune][collatz-prize], and a place in history awaits whoever could unlock its secrets.

[collatz-prize]: https://mathprize.net/posts/collatz-conjecture/
4 changes: 2 additions & 2 deletions exercises/practice/collatz-conjecture/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
]
},
"blurb": "Calculate the number of steps to reach 1 using the Collatz conjecture.",
"source": "An unsolved problem in mathematics named after mathematician Lothar Collatz",
"source_url": "https://en.wikipedia.org/wiki/3x_%2B_1_problem"
"source": "Wikipedia",
"source_url": "https://en.wikipedia.org/wiki/Collatz_conjecture"
}
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 :)
3 changes: 3 additions & 0 deletions exercises/practice/kindergarten-garden/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
],
"example": [
".meta/src/example.art"
],
"invalidator": [
"tester.art"
]
},
"blurb": "Given a diagram, determine which plants each child in the kindergarten class is responsible for.",
Expand Down
3 changes: 3 additions & 0 deletions exercises/practice/luhn/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
],
"example": [
".meta/src/example.art"
],
"invalidator": [
"tester.art"
]
},
"blurb": "Given a number determine whether or not it is valid per the Luhn formula.",
Expand Down
12 changes: 12 additions & 0 deletions exercises/practice/phone-number/.docs/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Introduction

You've joined LinkLine, a leading communications company working to ensure reliable connections for everyone.
The team faces a big challenge: users submit phone numbers in all sorts of formats — dashes, spaces, dots, parentheses, and even prefixes.
Some numbers are valid, while others are impossible to use.

Your mission is to turn this chaos into order.
You'll clean up valid numbers, formatting them appropriately for use in the system.
At the same time, you'll identify and filter out any invalid entries.

The success of LinkLine's operations depends on your ability to separate the useful from the unusable.
Are you ready to take on the challenge and keep the connections running smoothly?
3 changes: 3 additions & 0 deletions exercises/practice/proverb/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
],
"example": [
".meta/src/example.art"
],
"invalidator": [
"tester.art"
]
},
"blurb": "For want of a horseshoe nail, a kingdom was lost, or so the saying goes. Output the full text of this proverbial rhyme.",
Expand Down
3 changes: 3 additions & 0 deletions exercises/practice/queen-attack/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
],
"example": [
".meta/src/example.art"
],
"invalidator": [
"tester.art"
]
},
"blurb": "Given the position of two queens on a chess board, indicate whether or not they are positioned so that they can attack each other.",
Expand Down
3 changes: 3 additions & 0 deletions exercises/practice/word-count/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
],
"example": [
".meta/src/example.art"
],
"invalidator": [
"tester.art"
]
},
"blurb": "Given a phrase, count the occurrences of each word in that phrase.",
Expand Down

0 comments on commit 1dba666

Please sign in to comment.