Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert backtick (`) admonition fences to tildes (~) #2495

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/bob/.approaches/answer-array/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ The correct answer is selected from the array by using the score as the array in
The `String` [`trim()`][trim] method is applied to the input to eliminate any whitespace at either end of the input.
If the string has no characters left, it returns the response for saying nothing.

```exercism/caution
~~~~exercism/caution
Note that a `null` `string` would be different from a `String` of all whitespace.
A `null` `String` would throw a `NullPointerException` if `trim()` were applied to it.
```
~~~~

A [Pattern][pattern] is defined to look for at least one English alphabetic character.

Expand Down
4 changes: 2 additions & 2 deletions exercises/practice/bob/.approaches/if-statements/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ Execution will either return or will continue to the next statement anyway.
The `String` [`trim()`][trim] method is applied to the input to eliminate any whitespace at either end of the input.
If the string has no characters left, it returns the response for saying nothing.

```exercism/caution
~~~~exercism/caution
Note that a `null` `string` would be different from a `String` of all whitespace.
A `null` `String` would throw a `NullPointerException` if `trim()` were applied to it.
```
~~~~

A [Pattern][pattern] is defined to look for at least one English alphabetic character.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ Another lambda is used to process the input number.
[Bitwise operators][bitwise-operators] are used to check if the number is odd and to divide it in half if it is even.
The bitwise AND operator (`&`) compares the number with `1` to see if it is odd.

```exercism/note
~~~~exercism/note
Another way to go about checking if the number is even or odd is to see if it is evenly divided by `2`
by using the [modulo (also know as the remainder) operator](https://www.geeksforgeeks.org/modulo-or-remainder-operator-in-java/).
So, to see if it is even we could use `start % 2 == 0`.
That might be slightly less performant but perhaps more readable for intent, especially for those who don't "speak binary".
```
~~~~

If the number is even, then the right shift operator (`>>`) shifts all of the bits once to the right, which is the equivalent
of dividing the number by `2`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ If the number is already `1` before control flow gets to the `while` loop, then
[Bitwise operators][bitwise-operators] are used to check if the number is odd and to divide it in half if it is even.
The bitwise AND operator (`&`) compares the number with `1` to see if it is odd.

```exercism/note
~~~~exercism/note
Another way to go about checking if the number is even or odd is to see if it is evenly divided by `2`
by using the [modulo (also know as the remainder) operator](https://www.geeksforgeeks.org/modulo-or-remainder-operator-in-java/).
So, to see if it is even we could use `if (start % 2 == 0)`.
That might be slightly less performant but perhaps more readable for intent, especially for those who don't "speak binary".
```
~~~~

If the number is even, then the right shift equals operator (`>>=`) shifts all of the bits once to the right, which is the equivalent
of dividing the number by `2`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ Then the radius of the dart throw is calculated and assigned to a variable.
A `DoublePredicate` is defined as a [lambda][lambda] that takes in a `double` value that represents the ring radius
and compares it with the dart throw radius.

```exercism/note
~~~~exercism/note
Although the dart throw radius is not directly passed to the lambda, the lambda can use it.
To do so is called [capturing](https://www.geeksforgeeks.org/java-lambda-expression-variable-capturing-with-examples/) the variable.
To capture a variable, it must be in the enclosing [scope](https://www.geeksforgeeks.org/variable-scope-in-java/)
of the lambda, and it must be effectively `final`,
meaning that is is not changed in the course of the program.
```
~~~~

```exercism/note
~~~~exercism/note
The reason `DoublePredicate` is used instead of `Predicate<Double>` is to avoid the
[autoboxing](https://docs.oracle.com/javase/tutorial/java/data/autoboxing.html)
that `Predicate<Double>` would do.
`DoublePredicate` handles its primitive `double` argument without boxing it.
This is also why the lambda is required to be given a specific target type instead of `var`,
since the same lambda could be used for either `DoublePredicate` or `Predicate<Double>`.
```
~~~~

A series of calls to the `DoublePredicate` is then made.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ class DifferenceOfSquaresCalculator {

This solution iterates using the [`rangeClosed()`][rangeclosed] method of the [`IntStream`][intstream] class.

```exercism/note
~~~~exercism/note
The difference between `rangeClosed()` and [`range()`](https://docs.oracle.com/javase/8/docs/api/java/util/stream/IntStream.html#range-int-int-)
is that the ending bound is _inclusive_ for `rangeClosed()` and _exclusive_ for `range()`.
So, `IntStream.range(1, 10)` iterates from `1` up to but not including `10`,
and `IntStream.rangeClosed(1, 10)` iterates from `1` through `10`.
```
~~~~

In `computeSquareOfSumTo`, the numbers are added with the [`sum()`][sum] method.
The sum of the numbers is then multiplied by itself to get the square of the summed numbers.
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.
```
~~~~
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/
```
~~~~
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ If so, it gets the digit value of the codepoint by subtracting the [ASCII][ascii
So, if the codepoint is a `0`, then subtracting the ASCII value of `0` from itself results in `0`.
If the codepoint is a `1`, then subtracting the ASCII value of `0` from the ASCII value of `1` results in `1`, and so on.

```exercism/note/
~~~~exercism/note/
Another way to convert the codepoint to a digit is to use the built-in
[`Character.digit()`](https://docs.oracle.com/javase/7/docs/api/java/lang/Character.html#digit(char,%20int))
method, which also works for [Unicode](https://docs.oracle.com/javase/tutorial/i18n/text/unicode.html) codepoints.
Since for this exercise all of the codepoints are ASCII, simple ASCII math will do.
```
~~~~

The digit is multiplied by 10 minus the position, with the position starting at `0`.
So, for the position furthest to the left, the digit is multiplied by `10 - 0` (`10`).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ If so, it gets the digit value of the `char` by subtracting the [ASCII][ascii] v
So, if the `char` is a `0`, then subtracting the ASCII value of `0` from itself results in `0`.
If the `char` is a `1`, then subtracting the ASCII value of `0` from the ASCII value of `1` results in `1`, and so on.

```exercism/note/
~~~~exercism/note/
Another way to convert the `char` to a digit is to use the built-in
[`Character.digit()`](https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html#isDigit-char-)
method, which also works for [Unicode](https://docs.oracle.com/javase/tutorial/i18n/text/unicode.html) `char`s.
Since for this exercise all of the `chars` are ASCII, simple ASCII math will do.
```
~~~~

The digit is multiplied by 10 minus the position, with the position starting at `0`.
So, for the position furthest to the left, the digit is multiplied by `10 - 0` (`10`).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ So, if the character is a `0`, then subtracting the ASCII value of `0` from itse
If the character is a `1`, then subtracting the ASCII value of `0` from the ASCII value of `1` results in `1`,
and so on.

```exercism/note/
~~~~exercism/note/
Another way to convert the character to a digit is to use the built-in
[`Character.digit()`](https://docs.oracle.com/javase/7/docs/api/java/lang/Character.html#digit(char,%20int))
method, which also works for [Unicode](https://docs.oracle.com/javase/tutorial/i18n/text/unicode.html) digits.
Since for this exercise all of the digits are ASCII, simple ASCII math will do.
```
~~~~

The digit is multiplied by 10 minus the position, with the position starting at `0`.
So, for the position furthest to the left, the digit is multiplied by `10 - 0` (`10`).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ In the `isIsogram()` method, the [`chars()`][chars] method is called on the inpu
Each character is passed as a primitive `int` representing its [Unicode codepoint][char] to the [`filter()`][filter] method.
The `filter()` passes each codepoint to the [`IsLetter()`][isletter-codepoint] method to filter in only letter characters.

```exercism/note
~~~~exercism/note
Another method that could be used is [`isAlphabetic()`](https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html#isAlphabetic-int-).
For the difference between `isAlphabetic()` and `isLetter()`, see [here](https://www.baeldung.com/java-character-isletter-isalphabetic).
```
~~~~

The surviving codepoints are passed to the [`map()`][map] method which converts the codepoints to lower case.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ In the `isIsogram()` method, the [`chars()`][chars] method is called on the inpu
Each character is passed as a primitive `int` representing its [Unicode codepoint][char] to the [`filter()`][filter] method.
The `filter()` passes each codepoint to the [`IsLetter()`][isletter-codepoint] method to filter in only letter characters.

```exercism/note
~~~~exercism/note
Another method that could be used is [`isAlphabetic()`](https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html#isAlphabetic-int-).
For the difference between `isAlphabetic()` and `isLetter()`, see [here](https://www.baeldung.com/java-character-isletter-isalphabetic).
```
~~~~

The surviving codepoints are passed to the [`mapToObj()`][maptoobj] method which converts each codepoint to a lowercased codepoint.

Expand Down
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
```
~~~~
4 changes: 2 additions & 2 deletions exercises/practice/pangram/.approaches/containsall/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ This approach starts by importing from packages for what is needed.
The input `String` is lowercased and chained into the [`split()`][split] method to create an array of `String`s.
The enclosing [`Arrays.asList()`][aslist] method converts the `String` array into a [`List`][list] of `String`s.

```exercism/note
~~~~exercism/note
The `chars()` and `toCharArray()` methods won't work for `Arrays.asList()` because they produce primitive `int`s or `char`s
respectively.
For `Arrays.asList()` to work as desired, it must take an array of reference types.
The `split()` method is used here because it returns an array of `String`s, and `String` is a reference type.
```
~~~~

The `List` of input character `String`s is chained to the [`containsAll()`][containsall] method.
A `String` `List` of the English lowercase letters is passed to `containsAll()`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ The input `String` is lowercased and chained into the [`chars()`][chars] method.
Each character is passed as a primitive `int` representing its [Unicode codepoint][char] to the [`filter()`][filter] method.
The `filter()` passes each codepoint to the [`IsLetter()`][isletter-codepoint] method to filter in only letter characters.

```exercism/note
~~~~exercism/note
Another method that could be used is [`isAlphabetic()`](https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html#isAlphabetic-int-).
For the difference between `isAlphabetic()` and `isLetter()`, see [here](https://www.baeldung.com/java-character-isletter-isalphabetic).
```
~~~~

The the [`count()`][count] of the [`distinct()`][distinct] surviving codepoints are compared with the number of letters expected,
which for the English alphabet is `26`.
Expand Down
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 @@ -75,12 +75,12 @@ Finally, the word is made into Pig Latin by getting a [`substring()`][substring-
to which is concatenated a [`substring()`][substring-two] from the beginning of the word up to but not including the indexed character,
and concatenating `ay`.

```exercism/note
~~~~exercism/note
Note that there are two overloads of the `substring()` method.
One takes one argument which will return a substring from the index of the argument until the end of the `String`.
The other takes two arguments: the starting index and the ending index.
It returns a substring from the starting index up to but not including the ending index.
```
~~~~

After all of the words are iterated, the `ArrayList` of words is assembled into a single `String` by using the
[`String.join()`][join] method to join all of the words together, separated by a single space,
Expand Down
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
4 changes: 2 additions & 2 deletions exercises/practice/rna-transcription/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/
```
~~~~
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ to generate the second letter.
In another `forEach()`, the second letter is passed in a lambda function that calls [`IntStream.range()`][range] to generate
a number from `0` up to but not including `1000`.

```exercism/note
~~~~exercism/note
Note that the difference between `IntStream range()` and `IntStream rangeClosed()` is that the upper bound is _exclusive_
for `range()` and is _inclusive_ for `rangeClosed()`.
So, `IntStream.range(1, 10)` iterates from `1` up to but not including `10`,
and `IntStream.rangeClosed(1, 10)` iterates from `1` through `10`.
```
~~~~

The number is passed to a lambda which formats the two ASCII values and the number into a string.
The `%03d` [format specifier][format-specifiers] indicates having leading zeros for a number up to three places,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ because its value does not need to be changed once it is set.

In the constructor, a local variable is defined for being updated in the [`for` loop][for-loop].

```exercism/note
~~~~exercism/note
Using the same for a variable in a nested local scope that is used in its enclosing higher scope is called
[variable shadowing](https://www.geeksforgeeks.org/shadowing-in-java/).
```
~~~~

The variable is updated by a series of `if` statements that checks each letter of the uppercased word.
The letter is selected as a `String` by the [`substring()`][substring] method and is passed to the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,18 @@ because its value does not need to be changed once it is set.

In the constructor, a local variable is defined for being updated in the [`for` loop][for-loop].

```exercism/note
~~~~exercism/note
Using the same for a variable in a nested local scope that is used in its enclosing higher scope is called
[variable shadowing](https://www.geeksforgeeks.org/shadowing-in-java/).
```
~~~~

The variable is updated by a [`switch`][switch] statement that checks each letter of the lowercased word.

```exercism/note
~~~~exercism/note
If most of the input will already be lower case, it is a bit more performant to normalize the input as lowercased,
since fewer characters will need to be changed.
However, it may be considered that to use upper case letters is more readable.
```
~~~~

The letter is selected as a `char` by the [`charAt()`][charat] method and is passed to the
`switch`, with each case representing the letters for a particular score.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ It does this by use of the [left shift operator][left-shift].
So, if the bit index is `2`, then `1` would be shifted left two places for a binary value of `0100`, which is decimal `4`.
It then compares the bitwise value with the `int` argument to the `calculateHandshake()` method by using the [bitwise AND operator][and].

```exercism/note
~~~~exercism/note
Although the argument to `calculateHandshake()` is not directly passed to the lambda, the lambda can use it.
To do so is called [capturing](https://www.geeksforgeeks.org/java-lambda-expression-variable-capturing-with-examples/) the variable.
To capture a variable, it must be in the enclosing [scope](https://www.geeksforgeeks.org/variable-scope-in-java/)
of the lambda, and it must be effectively `final`,
meaning that is is not changed in the course of the program.
```
~~~~

If comparing the bitwise value with the input results in a non-zero bitwise value, then the input contains the value of the bitwise value.

Expand Down
Loading