Skip to content

Commit

Permalink
configlet sync for docs and metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
BNAndras committed Oct 26, 2023
1 parent 6760cb8 commit ad1319a
Show file tree
Hide file tree
Showing 33 changed files with 147 additions and 113 deletions.
2 changes: 1 addition & 1 deletion exercises/practice/accumulate/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
},
"blurb": "Implement the `accumulate` operation, which, given a collection and an operation to perform on each element of the collection, returns a new collection containing the result of applying that operation to each element of the input collection.",
"source": "Conversation with James Edward Gray II",
"source_url": "https://twitter.com/jeg2"
"source_url": "http://graysoftinc.com/"
}
10 changes: 5 additions & 5 deletions exercises/practice/acronym/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Punctuation is handled as follows: hyphens are word separators (like whitespace)

For example:

|Input|Output|
|-|-|
|As Soon As Possible|ASAP|
|Liquid-crystal display|LCD|
|Thank George It's Friday!|TGIF|
| Input | Output |
| ------------------------- | ------ |
| As Soon As Possible | ASAP |
| Liquid-crystal display | LCD |
| Thank George It's Friday! | TGIF |
4 changes: 2 additions & 2 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 @@ -23,7 +23,7 @@ Where:
For the Roman alphabet `m` is `26`.
- `a` and `b` are integers which make 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]).
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.
Otherwise it should encrypt or decrypt with the provided key.

Expand Down
8 changes: 4 additions & 4 deletions exercises/practice/all-your-base/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ Given a number in base **a**, represented as a sequence of digits, convert it to

In positional notation, a number in base **b** can be understood as a linear combination of powers of **b**.

The number 42, *in base 10*, means:
The number 42, _in base 10_, means:

`(4 * 10^1) + (2 * 10^0)`

The number 101010, *in base 2*, means:
The number 101010, _in base 2_, means:

`(1 * 2^5) + (0 * 2^4) + (1 * 2^3) + (0 * 2^2) + (1 * 2^1) + (0 * 2^0)`

The number 1120, *in base 3*, means:
The number 1120, _in base 3_, means:

`(1 * 3^3) + (1 * 3^2) + (2 * 3^1) + (0 * 3^0)`

I think you got the idea!

*Yes. Those three numbers above are exactly the same. Congratulations!*
_Yes. Those three numbers above are exactly the same. Congratulations!_

[positional-notation]: https://en.wikipedia.org/wiki/Positional_notation
2 changes: 1 addition & 1 deletion exercises/practice/allergies/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ Now, given just that score of 34, your program should be able to say:
- Whether Tom is allergic to any one of those allergens listed above.
- All the allergens Tom is allergic to.

Note: a given score may include allergens **not** listed above (i.e. allergens that score 256, 512, 1024, etc.).
Note: a given score may include allergens **not** listed above (i.e. allergens that score 256, 512, 1024, etc.).
Your program should ignore those components of the score.
For example, if the allergy score is 257, your program should only report the eggs (1) allergy.
4 changes: 2 additions & 2 deletions exercises/practice/armstrong-numbers/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ An [Armstrong number][armstrong-number] is a number that is the sum of its own d
For example:

- 9 is an Armstrong number, because `9 = 9^1 = 9`
- 10 is *not* an Armstrong number, because `10 != 1^2 + 0^2 = 1`
- 10 is _not_ an Armstrong number, because `10 != 1^2 + 0^2 = 1`
- 153 is an Armstrong number, because: `153 = 1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153`
- 154 is *not* an Armstrong number, because: `154 != 1^3 + 5^3 + 4^3 = 1 + 125 + 64 = 190`
- 154 is _not_ an Armstrong number, because: `154 != 1^3 + 5^3 + 4^3 = 1 + 125 + 64 = 190`

Write some code to determine whether a number is an Armstrong number.

Expand Down
3 changes: 1 addition & 2 deletions exercises/practice/binary-search-tree/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@
]
},
"blurb": "Insert and search for numbers in a binary tree.",
"source": "Josh Cheek",
"source_url": "https://twitter.com/josh_cheek"
"source": "Josh Cheek"
}
14 changes: 7 additions & 7 deletions exercises/practice/bowling/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ There are three cases for the tabulation of a frame.

Here is a three frame example:

| Frame 1 | Frame 2 | Frame 3 |
| :-------------: |:-------------:| :---------------------:|
| X (strike) | 5/ (spare) | 9 0 (open frame) |
| Frame 1 | Frame 2 | Frame 3 |
| :--------: | :--------: | :--------------: |
| X (strike) | 5/ (spare) | 9 0 (open frame) |

Frame 1 is (10 + 5 + 5) = 20

Expand All @@ -36,7 +36,7 @@ Frame 3 is (9 + 0) = 9
This means the current running total is 48.

The tenth frame in the game is a special case.
If someone throws a strike or a spare then they get a fill ball.
If someone throws a spare or a strike then they get one or two fill balls respectively.
Fill balls exist to calculate the total of the 10th frame.
Scoring a strike or spare on the fill ball does not give the player more fill balls.
The total value of the 10th frame is the total number of pins knocked down.
Expand All @@ -50,7 +50,7 @@ For a tenth frame of XXX (three strikes), the total value is 30.
Write code to keep track of the score of a game of bowling.
It should support two operations:

- `roll(game: Game, knocked_pins: Int)` is called each time the player rolls a ball.
- `roll(pins : int)` is called each time the player rolls a ball.
The argument is the number of pins knocked down.
- `score(game: Game)` is called only at the very end of the game.
It returns the total score for that game, wrapped in a `Result`.
- `score() : int` is called only at the very end of the game.
It returns the total score for that game.
48 changes: 32 additions & 16 deletions exercises/practice/circular-buffer/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,55 @@ A circular buffer, cyclic buffer or ring buffer is a data structure that uses a

A circular buffer first starts empty and of some predefined length.
For example, this is a 7-element buffer:
<!-- prettier-ignore -->
[ ][ ][ ][ ][ ][ ][ ]

```text
[ ][ ][ ][ ][ ][ ][ ]
```

Assume that a 1 is written into the middle of the buffer (exact starting location does not matter in a circular buffer):
<!-- prettier-ignore -->
[ ][ ][ ][1][ ][ ][ ]

```text
[ ][ ][ ][1][ ][ ][ ]
```

Then assume that two more elements are added — 2 & 3 — which get appended after the 1:
<!-- prettier-ignore -->
[ ][ ][ ][1][2][3][ ]

```text
[ ][ ][ ][1][2][3][ ]
```

If two elements are then removed from the buffer, the oldest values inside the buffer are removed.
The two elements removed, in this case, are 1 & 2, leaving the buffer with just a 3:
<!-- prettier-ignore -->
[ ][ ][ ][ ][ ][3][ ]

```text
[ ][ ][ ][ ][ ][3][ ]
```

If the buffer has 7 elements then it is completely full:
<!-- prettier-ignore -->
[5][6][7][8][9][3][4]

```text
[5][6][7][8][9][3][4]
```

When the buffer is full an error will be raised, alerting the client that further writes are blocked until a slot becomes free.

When the buffer is full, the client can opt to overwrite the oldest data with a forced write.
In this case, two more elements — A & B — are added and they overwrite the 3 & 4:
<!-- prettier-ignore -->
[5][6][7][8][9][A][B]

```text
[5][6][7][8][9][A][B]
```

3 & 4 have been replaced by A & B making 5 now the oldest data in the buffer.
Finally, if two elements are removed then what would be returned is 5 & 6 yielding the buffer:
<!-- prettier-ignore -->
[ ][ ][7][8][9][A][B]

```text
[ ][ ][7][8][9][A][B]
```

Because there is space available, if the client again uses overwrite to store C & D then the space where 5 & 6 were stored previously will be used not the location of 7 & 8.
7 is still the oldest element and the buffer is once again full.
<!-- prettier-ignore -->
[C][D][7][8][9][A][B]

```text
[C][D][7][8][9][A][B]
```
3 changes: 1 addition & 2 deletions exercises/practice/clock/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@
]
},
"blurb": "Implement a clock that handles times without dates.",
"source": "Pairing session with Erin Drummond",
"source_url": "https://twitter.com/ebdrummond"
"source": "Pairing session with Erin Drummond"
}
10 changes: 9 additions & 1 deletion exercises/practice/darts/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,26 @@ Write a function that returns the earned points in a single toss of a Darts game

In our particular instance of the game, the target rewards 4 different amounts of points, depending on where the dart lands:

![Our dart scoreboard with values from a complete miss to a bullseye](https://assets.exercism.org/images/exercises/darts/darts-scoreboard.svg)

- If the dart lands outside the target, player earns no points (0 points).
- If the dart lands in the outer circle of the target, player earns 1 point.
- If the dart lands in the middle circle of the target, player earns 5 points.
- If the dart lands in the inner circle of the target, player earns 10 points.

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

## Credit

The scoreboard image was created by [habere-et-dispertire][habere-et-dispertire] using [Inkscape][inkscape].

[darts]: https://en.wikipedia.org/wiki/Darts
[darts-target]: https://en.wikipedia.org/wiki/Darts#/media/File:Darts_in_a_dartboard.jpg
[concentric]: https://mathworld.wolfram.com/ConcentricCircles.html
[cartesian-coordinates]: https://www.mathsisfun.com/data/cartesian-coordinates.html
[real-numbers]: https://www.mathsisfun.com/numbers/real-numbers.html
[habere-et-dispertire]: https://exercism.org/profiles/habere-et-dispertire
[inkscape]: https://en.wikipedia.org/wiki/Inkscape
4 changes: 2 additions & 2 deletions exercises/practice/etl/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"manifest.toml"
]
},
"blurb": "We are going to do the `Transform` step of an Extract-Transform-Load.",
"source": "Exercise by the JumpstartLab team for students at The Turing School of Software and Design.",
"blurb": "Change the data format for scoring a game to more easily add other languages.",
"source": "Based on an exercise by the JumpstartLab team for students at The Turing School of Software and Design.",
"source_url": "https://turing.edu"
}
2 changes: 1 addition & 1 deletion exercises/practice/isogram/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ Examples of isograms:
- downstream
- six-year-old

The word *isograms*, however, is not an isogram, because the s repeats.
The word _isograms_, however, is not an isogram, because the s repeats.
5 changes: 4 additions & 1 deletion exercises/practice/knapsack/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ Given a knapsack with a specific carrying capacity (W), help Bob determine the m
Note that Bob can take only one of each item.

All values given will be strictly positive.
Items will be represented as a list of pairs, `wi` and `vi`, where the first element `wi` is the weight of the *i*th item and `vi` is the value for that item.
Items will be represented as a list of items.
Each item will have a weight and value.

For example:

```none
Items: [
{ "weight": 5, "value": 10 },
{ "weight": 4, "value": 40 },
Expand All @@ -25,6 +27,7 @@ Items: [
]
Knapsack Limit: 10
```

For the above, the first item has weight 5 and value 10, the second item has weight 4 and value 40, and so on.

Expand Down
18 changes: 10 additions & 8 deletions exercises/practice/list-ops/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ Implement a series of basic list operations, without using existing functions.

The precise number and names of the operations to be implemented will be track dependent to avoid conflicts with existing names, but the general operations you will implement include:

- `append` (*given two lists, add all items in the second list to the end of the first list*);
- `concatenate` (*given a series of lists, combine all items in all lists into one flattened list*);
- `filter` (*given a predicate and a list, return the list of all items for which `predicate(item)` is True*);
- `length` (*given a list, return the total number of items within it*);
- `map` (*given a function and a list, return the list of the results of applying `function(item)` on all items*);
- `foldl` (*given a function, a list, and initial accumulator, fold (reduce) each item into the accumulator from the left using `function(accumulator, item)`*);
- `foldr` (*given a function, a list, and an initial accumulator, fold (reduce) each item into the accumulator from the right using `function(item, accumulator)`*);
- `reverse` (*given a list, return a list with all the original items, but in reversed order*);
- `append` (_given two lists, add all items in the second list to the end of the first list_);
- `concatenate` (_given a series of lists, combine all items in all lists into one flattened list_);
- `filter` (_given a predicate and a list, return the list of all items for which `predicate(item)` is True_);
- `length` (_given a list, return the total number of items within it_);
- `map` (_given a function and a list, return the list of the results of applying `function(item)` on all items_);
- `foldl` (_given a function, a list, and initial accumulator, fold (reduce) each item into the accumulator from the left_);
- `foldr` (_given a function, a list, and an initial accumulator, fold (reduce) each item into the accumulator from the right_);
- `reverse` (_given a list, return a list with all the original items, but in reversed order_).

Note, the ordering in which arguments are passed to the fold functions (`foldl`, `foldr`) is significant.
2 changes: 1 addition & 1 deletion exercises/practice/pangram/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Your task is to figure out if a sentence is a pangram.
A pangram is a sentence using every letter of the alphabet at least once.
It is case insensitive, so it doesn't matter if a letter is lower-case (e.g. `k`) or upper-case (e.g. `K`).

For this exercise we only use the basic letters used in the English alphabet: `a` to `z`.
For this exercise, a sentence is a pangram if it contains each of the 26 letters in the English alphabet.
5 changes: 2 additions & 3 deletions exercises/practice/perfect-numbers/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Instructions

Determine if a number is perfect, abundant, or deficient based on
Nicomachus' (60 - 120 CE) classification scheme for positive integers.
Determine if a number is perfect, abundant, or deficient based on Nicomachus' (60 - 120 CE) classification scheme for positive integers.

The Greek mathematician [Nicomachus][nicomachus] devised a classification scheme for positive integers, identifying each as belonging uniquely to the categories of **perfect**, **abundant**, or **deficient** based on their [aliquot sum][aliquot-sum].
The aliquot sum is defined as the sum of the factors of a number not including the number itself.
For example, the aliquot sum of 15 is (1 + 3 + 5) = 9
For example, the aliquot sum of `15` is `1 + 3 + 5 = 9`.

- **Perfect**: aliquot sum = number
- 6 is a perfect number because (1 + 2 + 3) = 6
Expand Down
10 changes: 6 additions & 4 deletions exercises/practice/phone-number/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@ Clean up user-entered phone numbers so that they can be sent SMS messages.
The **North American Numbering Plan (NANP)** is a telephone numbering system used by many countries in North America like the United States, Canada or Bermuda.
All NANP-countries share the same international country code: `1`.

NANP numbers are ten-digit numbers consisting of a three-digit Numbering Plan Area code, commonly known as *area code*, followed by a seven-digit local number.
The first three digits of the local number represent the *exchange code*, followed by the unique four-digit number which is the *subscriber number*.
NANP numbers are ten-digit numbers consisting of a three-digit Numbering Plan Area code, commonly known as _area code_, followed by a seven-digit local number.
The first three digits of the local number represent the _exchange code_, followed by the unique four-digit number which is the _subscriber number_.

The format is usually represented as

```text
(NXX)-NXX-XXXX
NXX NXX-XXXX
```

where `N` is any digit from 2 through 9 and `X` is any digit from 0 through 9.

Your task is to clean up differently formatted telephone numbers by removing punctuation and the country code (1) if present.
Sometimes they also have the country code (represented as `1` or `+1`) prefixed.

Your task is to clean up differently formatted telephone numbers by removing punctuation and the country code if present.

For example, the inputs

Expand Down
3 changes: 2 additions & 1 deletion exercises/practice/pig-latin/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ It obeys a few simple rules (below), but when it's spoken quickly it's really di
- **Rule 1**: If a word begins with a vowel sound, add an "ay" sound to the end of the word.
Please note that "xr" and "yt" at the beginning of a word make vowel sounds (e.g. "xray" -> "xrayay", "yttria" -> "yttriaay").
- **Rule 2**: If a word begins with a consonant sound, move it to the end of the word and then add an "ay" sound to the end of the word.
Consonant sounds can be made up of multiple consonants, a.k.a. a consonant cluster (e.g. "chair" -> "airchay").
Consonant sounds can be made up of multiple consonants, such as the "ch" in "chair" or "st" in "stand" (e.g. "chair" -> "airchay").
- **Rule 3**: If a word starts with a consonant sound followed by "qu", move it to the end of the word, and then add an "ay" sound to the end of the word (e.g. "square" -> "aresquay").
- **Rule 4**: If a word contains a "y" after a consonant cluster or as the second letter in a two letter word it makes a vowel sound (e.g. "rhythm" -> "ythmrhay", "my" -> "ymay").

There are a few more rules for edge cases, and there are regional variants too.
Check the tests for all the details.

Read more about [Pig Latin on Wikipedia][pig-latin].

Expand Down
20 changes: 10 additions & 10 deletions exercises/practice/protein-translation/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ Note the stop codon `"UAA"` terminates the translation and the final methionine

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

Codon | Protein
:--- | :---
AUG | Methionine
UUU, UUC | Phenylalanine
UUA, UUG | Leucine
UCU, UCC, UCA, UCG | Serine
UAU, UAC | Tyrosine
UGU, UGC | Cysteine
UGG | Tryptophan
UAA, UAG, UGA | STOP
| Codon | Protein |
| :----------------- | :------------ |
| AUG | Methionine |
| UUU, UUC | Phenylalanine |
| UUA, UUG | Leucine |
| UCU, UCC, UCA, UCG | Serine |
| UAU, UAC | Tyrosine |
| UGU, UGC | Cysteine |
| UGG | Tryptophan |
| UAA, UAG, UGA | STOP |

Learn more about [protein translation on Wikipedia][protein-translation].

Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/queen-attack/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ So if you are told the white queen is at `c5` (zero-indexed at column 2, row 3)
a b c d e f g h
```

You are also be able to answer whether the queens can attack each other.
You are also able to answer whether the queens can attack each other.
In this case, that answer would be yes, they can, because both pieces share a diagonal.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ For this exercise, you need to know only three things about them:
- Grey: 8
- White: 9

In `resistor-color duo` you decoded the first two colors.
In Resistor Color Duo you decoded the first two colors.
For instance: orange-orange got the main value `33`.
The third color stands for how many zeros need to be added to the main value.
The main value plus the zeros gives us a value in ohms.
Expand Down
Loading

0 comments on commit ad1319a

Please sign in to comment.