Skip to content

Commit

Permalink
Ran configlet sync --docs --update (#2560)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cool-Katt authored Nov 13, 2024
1 parent 94f7341 commit dbfbeae
Show file tree
Hide file tree
Showing 36 changed files with 175 additions and 88 deletions.
6 changes: 3 additions & 3 deletions exercises/practice/affine-cipher/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The affine cipher is a type of monoalphabetic substitution cipher.
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.
Although all monoalphabetic ciphers are weak, the affine cipher is much stronger than the atbash cipher, because it has many more keys.

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

## Encryption

Expand All @@ -18,10 +18,10 @@ E(x) = (ai + b) mod m

Where:

- `i` is the letter's index from `0` to the length of the alphabet - 1
- `i` is the letter's index from `0` to the length of the alphabet - 1.
- `m` is the length of the alphabet.
For the Roman alphabet `m` is `26`.
- `a` and `b` are integers which make the encryption key
- `a` and `b` are integers which make up the encryption key.

Values `a` and `m` must be _coprime_ (or, _relatively prime_) for automatic decryption to succeed, i.e., they have number `1` as their only common factor (more information can be found in the [Wikipedia article about coprime integers][coprime-integers]).
In case `a` is not coprime to `m`, your program should indicate that this is an error.
Expand Down
4 changes: 1 addition & 3 deletions exercises/practice/alphametics/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Instructions

Write a function to solve alphametics puzzles.
Given an alphametics puzzle, find the correct solution.

[Alphametics][alphametics] is a puzzle where letters in words are replaced with numbers.

Expand All @@ -26,6 +26,4 @@ This is correct because every letter is replaced by a different number and the w

Each letter must represent a different digit, and the leading digit of a multi-digit number must not be zero.

Write a function to solve alphametics puzzles.

[alphametics]: https://en.wikipedia.org/wiki/Alphametics
2 changes: 1 addition & 1 deletion exercises/practice/bank-account/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Your task is to implement bank accounts supporting opening/closing, withdrawals, and deposits of money.

As bank accounts can be accessed in many different ways (internet, mobile phones, automatic charges), your bank software must allow accounts to be safely accessed from multiple threads/processes (terminology depends on your programming language) in parallel.
For example, there may be many deposits and withdrawals occurring in parallel; you need to ensure there is no [race conditions][wikipedia] between when you read the account balance and set the new balance.
For example, there may be many deposits and withdrawals occurring in parallel; you need to ensure there are no [race conditions][wikipedia] between when you read the account balance and set the new balance.

It should be possible to close an account; operations against a closed account must fail.

Expand Down
4 changes: 2 additions & 2 deletions exercises/practice/binary-search/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Your task is to implement a binary search algorithm.
A binary search algorithm finds an item in a list by repeatedly splitting it in half, only keeping the half which contains the item we're looking for.
It allows us to quickly narrow down the possible locations of our item until we find it, or until we've eliminated all possible locations.

```exercism/caution
~~~~exercism/caution
Binary search only works when a list has been sorted.
```
~~~~

The algorithm looks like this:

Expand Down
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
4 changes: 2 additions & 2 deletions exercises/practice/etl/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ This needs to be changed to store each individual letter with its score in a one

As part of this change, the team has also decided to change the letters to be lower-case rather than upper-case.

```exercism/note
~~~~exercism/note
If you want to look at how the data was previously structured and how it needs to change, take a look at the examples in the test suite.
```
~~~~
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
4 changes: 2 additions & 2 deletions exercises/practice/gigasecond/.docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ Then we can use metric system prefixes for writing large numbers of seconds in m
- Perhaps you and your family would travel to somewhere exotic for two megaseconds (that's two million seconds).
- And if you and your spouse were married for _a thousand million_ seconds, you would celebrate your one gigasecond anniversary.

```exercism/note
~~~~exercism/note
If we ever colonize Mars or some other planet, measuring time is going to get even messier.
If someone says "year" do they mean a year on Earth or a year on Mars?
The idea for this exercise came from the science fiction novel ["A Deepness in the Sky"][vinge-novel] by author Vernor Vinge.
In it the author uses the metric system as the basis for time measurements.
[vinge-novel]: https://www.tor.com/2017/08/03/science-fiction-with-something-for-everyone-a-deepness-in-the-sky-by-vernor-vinge/
```
~~~~
6 changes: 3 additions & 3 deletions exercises/practice/go-counting/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Count the scored points on a Go board.
In the game of go (also known as baduk, igo, cờ vây and wéiqí) points are gained by completely encircling empty intersections with your stones.
The encircled intersections of a player are known as its territory.

Write a function that determines the territory of each player.
Calculate the territory of each player.
You may assume that any stones that have been stranded in enemy territory have already been taken off the board.

Write a function that determines the territory which includes a specified coordinate.
Determine the territory which includes a specified coordinate.

Multiple empty intersections may be encircled at once and for encircling only horizontal and vertical neighbors count.
In the following diagram the stones which matter are marked "O" and the stones that don't are marked "I" (ignored).
Expand All @@ -25,7 +25,7 @@ Empty spaces represent empty intersections.

To be more precise an empty intersection is part of a player's territory if all of its neighbors are either stones of that player or empty intersections that are part of that player's territory.

For more information see [wikipedia][go-wikipedia] or [Sensei's Library][go-sensei].
For more information see [Wikipedia][go-wikipedia] or [Sensei's Library][go-sensei].

[go-wikipedia]: https://en.wikipedia.org/wiki/Go_%28game%29
[go-sensei]: https://senseis.xmp.net/
10 changes: 5 additions & 5 deletions exercises/practice/hamming/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 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.
Expand All @@ -9,18 +9,18 @@ In fact, the average human body experiences about 10 quadrillion cell divisions
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".
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.
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 :)
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

Expand Down
4 changes: 2 additions & 2 deletions exercises/practice/leap/.docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ Some examples:
- 1900 was not a leap year as it's not divisible by 400.
- 2000 was a leap year!

```exercism/note
~~~~exercism/note
For a delightful, four-minute explanation of the whole phenomenon of leap years, check out [this YouTube video](https://www.youtube.com/watch?v=xX96xng7sAE).
```
~~~~
4 changes: 2 additions & 2 deletions exercises/practice/linked-list/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Sometimes a station gets closed down, and in that case the station needs to be r

The size of a route is measured not by how far the train travels, but by how many stations it stops at.

```exercism/note
~~~~exercism/note
The linked list is a fundamental data structure in computer science, often used in the implementation of other data structures.
As the name suggests, it is a list of nodes that are linked together.
It is a list of "nodes", where each node links to its neighbor or neighbors.
Expand All @@ -23,4 +23,4 @@ In a **doubly linked list** each node links to both the node that comes before,
If you want to dig deeper into linked lists, check out [this article][intro-linked-list] that explains it using nice drawings.
[intro-linked-list]: https://medium.com/basecs/whats-a-linked-list-anyway-part-1-d8b7e6508b9d
```
~~~~
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
3 changes: 2 additions & 1 deletion exercises/practice/matching-brackets/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Instructions

Given a string containing brackets `[]`, braces `{}`, parentheses `()`, or any combination thereof, verify that any and all pairs are matched and nested correctly.
The string may also contain other characters, which for the purposes of this exercise should be ignored.
Any other characters should be ignored.
For example, `"{what is (42)}?"` is balanced and `"[text}"` is not.
8 changes: 8 additions & 0 deletions exercises/practice/matching-brackets/.docs/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Introduction

You're given the opportunity to write software for the Bracketeer™, an ancient but powerful mainframe.
The software that runs on it is written in a proprietary language.
Much of its syntax is familiar, but you notice _lots_ of brackets, braces and parentheses.
Despite the Bracketeer™ being powerful, it lacks flexibility.
If the source code has any unbalanced brackets, braces or parentheses, the Bracketeer™ crashes and must be rebooted.
To avoid such a scenario, you start writing code that can verify that brackets, braces, and parentheses are balanced before attempting to run it on the Bracketeer™.
4 changes: 2 additions & 2 deletions exercises/practice/pangram/.docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ To give a comprehensive sense of the font, the random sentences should use **all
They're running a competition to get suggestions for sentences that they can use.
You're in charge of checking the submissions to see if they are valid.

```exercism/note
~~~~exercism/note
Pangram comes from Greek, παν γράμμα, pan gramma, which means "every letter".
The best known English pangram is:
> The quick brown fox jumps over the lazy dog.
```
~~~~
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Count the frequency of letters in texts using parallel computation.

Parallelism is about doing things in parallel that can also be done sequentially.
A common example is counting the frequency of letters.
Create a function that returns the total frequency of each letter in a list of texts and that employs parallelism.
Employ parallelism to calculate the total frequency of each letter in a list of texts.
27 changes: 24 additions & 3 deletions exercises/practice/pascals-triangle/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
# Instructions

Compute Pascal's triangle up to a given number of rows.
Your task is to output the first N rows of Pascal's triangle.

In Pascal's Triangle each number is computed by adding the numbers to the right and left of the current position in the previous row.
[Pascal's triangle][wikipedia] is a triangular array of positive integers.

In Pascal's triangle, the number of values in a row is equal to its row number (which starts at one).
Therefore, the first row has one value, the second row has two values, and so on.

The first (topmost) row has a single value: `1`.
Subsequent rows' values are computed by adding the numbers directly to the right and left of the current position in the previous row.

If the previous row does _not_ have a value to the left or right of the current position (which only happens for the leftmost and rightmost positions), treat that position's value as zero (effectively "ignoring" it in the summation).

## Example

Let's look at the first 5 rows of Pascal's Triangle:

```text
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
# ... etc
```

The topmost row has one value, which is `1`.

The leftmost and rightmost values have only one preceding position to consider, which is the position to its right respectively to its left.
With the topmost value being `1`, it follows from this that all the leftmost and rightmost values are also `1`.

The other values all have two positions to consider.
For example, the fifth row's (`1 4 6 4 1`) middle value is `6`, as the values to its left and right in the preceding row are `3` and `3`:

[wikipedia]: https://en.wikipedia.org/wiki/Pascal%27s_triangle
22 changes: 22 additions & 0 deletions exercises/practice/pascals-triangle/.docs/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Introduction

With the weather being great, you're not looking forward to spending an hour in a classroom.
Annoyed, you enter the class room, where you notice a strangely satisfying triangle shape on the blackboard.
Whilst waiting for your math teacher to arrive, you can't help but notice some patterns in the triangle: the outer values are all ones, each subsequent row has one more value than its previous row and the triangle is symmetrical.
Weird!

Not long after you sit down, your teacher enters the room and explains that this triangle is the famous [Pascal's triangle][wikipedia].

Over the next hour, your teacher reveals some amazing things hidden in this triangle:

- It can be used to compute how many ways you can pick K elements from N values.
- It contains the Fibonacci sequence.
- If you color odd and even numbers differently, you get a beautiful pattern called the [Sierpiński triangle][wikipedia-sierpinski-triangle].

The teacher implores you and your classmates to lookup other uses, and assures you that there are lots more!
At that moment, the school bell rings.
You realize that for the past hour, you were completely absorbed in learning about Pascal's triangle.
You quickly grab your laptop from your bag and go outside, ready to enjoy both the sunshine _and_ the wonders of Pascal's triangle.

[wikipedia]: https://en.wikipedia.org/wiki/Pascal%27s_triangle
[wikipedia-sierpinski-triangle]: https://en.wikipedia.org/wiki/Sierpi%C5%84ski_triangle
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
2 changes: 1 addition & 1 deletion exercises/practice/poker/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

Pick the best hand(s) from a list of poker hands.

See [wikipedia][poker-hands] for an overview of poker hands.
See [Wikipedia][poker-hands] for an overview of poker hands.

[poker-hands]: https://en.wikipedia.org/wiki/List_of_poker_hands
4 changes: 2 additions & 2 deletions exercises/practice/rational-numbers/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

A rational number is defined as the quotient of two integers `a` and `b`, called the numerator and denominator, respectively, where `b != 0`.

```exercism/note
~~~~exercism/note
Note that mathematically, the denominator can't be zero.
However in many implementations of rational numbers, you will find that the denominator is allowed to be zero with behaviour similar to positive or negative infinity in floating point numbers.
In those cases, the denominator and numerator generally still can't both be zero at once.
```
~~~~

The absolute value `|r|` of the rational number `r = a/b` is equal to `|a|/|b|`.

Expand Down
10 changes: 5 additions & 5 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 All @@ -15,6 +15,6 @@ Given a DNA strand, its transcribed RNA strand is formed by replacing each nucle
- `T` -> `A`
- `A` -> `U`

```exercism/note
~~~~exercism/note
If you want to look at how the inputs and outputs are structured, take a look at the examples in the test suite.
```
~~~~
4 changes: 2 additions & 2 deletions exercises/practice/rna-transcription/.docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ You work for a bioengineering company that specializes in developing therapeutic

Your team has just been given a new project to develop a targeted therapy for a rare type of cancer.

```exercism/note
~~~~exercism/note
It's all very complicated, but the basic idea is that sometimes people's bodies produce too much of a given protein.
That can cause all sorts of havoc.
Expand All @@ -13,4 +13,4 @@ But if you can create a very specific molecule (called a micro-RNA), it can prev
This technique is called [RNA Interference][rnai].
[rnai]: https://admin.acceleratingscience.com/ask-a-scientist/what-is-rnai/
```
~~~~
2 changes: 0 additions & 2 deletions exercises/practice/say/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ Implement breaking a number up into chunks of thousands.

So `1234567890` should yield a list like 1, 234, 567, and 890, while the far simpler `1000` should yield just 1 and 0.

The program must also report any values that are out of range.

## Step 3

Now handle inserting the appropriate scale word between those chunks.
Expand Down
4 changes: 2 additions & 2 deletions exercises/practice/secret-handshake/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ The secret handshake for 26 is therefore:
jump, double blink
```

```exercism/note
~~~~exercism/note
If you aren't sure what binary is or how it works, check out [this binary tutorial][intro-to-binary].
[intro-to-binary]: https://medium.com/basecs/bits-bytes-building-with-binary-13cb4289aafa
```
~~~~
Loading

0 comments on commit dbfbeae

Please sign in to comment.