Skip to content

Commit cb1fa61

Browse files
authored
Use reference links in descriptions (#2113)
1 parent ef25a61 commit cb1fa61

File tree

38 files changed

+150
-65
lines changed

38 files changed

+150
-65
lines changed

exercises/all-your-base/description.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ represented as a sequence of digits, convert it to base **b**.
1010
- Try to implement the conversion yourself.
1111
Do not use something else to perform the conversion for you.
1212

13-
## About [Positional Notation](https://en.wikipedia.org/wiki/Positional_notation)
13+
## About [Positional Notation][positional-notation]
1414

1515
In positional notation, a number in base **b** can be understood as a linear
1616
combination of powers of **b**.
@@ -30,3 +30,5 @@ The number 1120, *in base 3*, means:
3030
I think you got the idea!
3131

3232
*Yes. Those three numbers above are exactly the same. Congratulations!*
33+
34+
[positional-notation]: https://en.wikipedia.org/wiki/Positional_notation

exercises/alphametics/description.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
Write a function to solve alphametics puzzles.
44

5-
[Alphametics](https://en.wikipedia.org/wiki/Alphametics) is a puzzle where
6-
letters in words are replaced with numbers.
5+
[Alphametics][] is a puzzle where letters in words are replaced with numbers.
76

87
For example `SEND + MORE = MONEY`:
98

@@ -30,3 +29,5 @@ Each letter must represent a different digit, and the leading digit of
3029
a multi-digit number must not be zero.
3130

3231
Write a function to solve alphametics puzzles.
32+
33+
[Alphametics]: https://en.wikipedia.org/wiki/Alphametics

exercises/armstrong-numbers/description.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Description
22

3-
An [Armstrong number](https://en.wikipedia.org/wiki/Narcissistic_number) is a number that is the sum of its own digits each raised to the power of the number of digits.
3+
An [Armstrong number][armstrong-number] is a number that is the sum of its own digits each raised to the power of the number of digits.
44

55
For example:
66

@@ -10,3 +10,5 @@ For example:
1010
- 154 is *not* an Armstrong number, because: `154 != 1^3 + 5^3 + 4^3 = 1 + 125 + 64 = 190`
1111

1212
Write some code to determine whether a number is an Armstrong number.
13+
14+
[armstrong-number]: https://en.wikipedia.org/wiki/Narcissistic_number

exercises/connect/description.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
Compute the result for a game of Hex / Polygon.
44

5-
The abstract boardgame known as
6-
[Hex](https://en.wikipedia.org/wiki/Hex_%28board_game%29) / Polygon /
5+
The abstract boardgame known as [Hex][] / Polygon /
76
CON-TAC-TIX is quite simple in rules, though complex in practice. Two players
87
place stones on a parallelogram with hexagonal fields. The player to connect his/her
98
stones to the opposite side first wins. The four sides of the parallelogram are
@@ -29,3 +28,5 @@ The boards look like this:
2928
"Player `O`" plays from top to bottom, "Player `X`" plays from left to right. In
3029
the above example `O` has made a connection from left to right but nobody has
3130
won since `O` didn't connect top and bottom.
31+
32+
[Hex]: https://en.wikipedia.org/wiki/Hex_%28board_game%29

exercises/darts/description.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
Write a function that returns the earned points in a single toss of a Darts game.
44

5-
[Darts](https://en.wikipedia.org/wiki/Darts) is a game where players
6-
throw darts at a [target](https://en.wikipedia.org/wiki/Darts#/media/File:Darts_in_a_dartboard.jpg).
5+
[Darts][] is a game where players
6+
throw darts at a [target][darts-target].
77

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

@@ -12,6 +12,12 @@ In our particular instance of the game, the target rewards 4 different amounts o
1212
* If the dart lands in the middle circle of the target, player earns 5 points.
1313
* If the dart lands in the inner circle of the target, player earns 10 points.
1414

15-
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](http://mathworld.wolfram.com/ConcentricCircles.html)) defined by the coordinates (0, 0).
15+
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).
1616

17-
Write a function that given a point in the target (defined by its [Cartesian coordinates](https://www.mathsisfun.com/data/cartesian-coordinates.html) `x` and `y`, where `x` and `y` are [real](https://www.mathsisfun.com/numbers/real-numbers.html)), returns the correct amount earned by a dart landing at that point.
17+
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.
18+
19+
[Darts]: https://en.wikipedia.org/wiki/Darts
20+
[darts-target]: https://en.wikipedia.org/wiki/Darts#/media/File:Darts_in_a_dartboard.jpg
21+
[concentric]: http://mathworld.wolfram.com/ConcentricCircles.html
22+
[cartesian-coordinates]: https://www.mathsisfun.com/data/cartesian-coordinates.html
23+
[real-numbers]: https://www.mathsisfun.com/numbers/real-numbers.html

exercises/dot-dsl/description.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
# Description
22

3-
A [Domain Specific Language
4-
(DSL)](https://en.wikipedia.org/wiki/Domain-specific_language) is a
3+
A [Domain Specific Language (DSL)][dsl] is a
54
small language optimized for a specific domain. Since a DSL is
65
targeted, it can greatly impact productivity/understanding by allowing the
76
writer to declare *what* they want rather than *how*.
87

98
One problem area where they are applied are complex customizations/configurations.
109

11-
For example the [DOT language](https://en.wikipedia.org/wiki/DOT_(graph_description_language)) allows
10+
For example the [DOT language][dot-language] allows
1211
you to write a textual description of a graph which is then transformed into a picture by one of
13-
the [Graphviz](http://graphviz.org/) tools (such as `dot`). A simple graph looks like this:
12+
the [Graphviz][] tools (such as `dot`). A simple graph looks like this:
1413

1514
graph {
1615
graph [bgcolor="yellow"]
@@ -30,4 +29,9 @@ to create graph data structures. However, unlike the DOT Language, our DSL will
3029
be an internal DSL for use only in our language.
3130

3231
More information about the difference between internal and external DSLs can be
33-
found [here](https://martinfowler.com/bliki/DomainSpecificLanguage.html).
32+
found [here][fowler-dsl].
33+
34+
[dsl]: https://en.wikipedia.org/wiki/Domain-specific_language
35+
[dot-language]: https://en.wikipedia.org/wiki/DOT_(graph_description_language)
36+
[Graphviz]: http://graphviz.org/
37+
[fowler-dsl]: https://martinfowler.com/bliki/DomainSpecificLanguage.html

exercises/food-chain/description.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ While you could copy/paste the lyrics,
66
or read them from a file, this problem is much more
77
interesting if you approach it algorithmically.
88

9-
This is a [cumulative song](http://en.wikipedia.org/wiki/Cumulative_song) of unknown origin.
9+
This is a [cumulative song][cumulative-song] of unknown origin.
1010

1111
This is one of many common variants.
1212

@@ -62,3 +62,5 @@ I don't know why she swallowed the fly. Perhaps she'll die.
6262
I know an old lady who swallowed a horse.
6363
She's dead, of course!
6464
```
65+
66+
[cumulative-song]: http://en.wikipedia.org/wiki/Cumulative_song

exercises/forth/description.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Implement an evaluator for a very simple subset of Forth.
44

5-
[Forth](https://en.wikipedia.org/wiki/Forth_%28programming_language%29)
5+
[Forth][]
66
is a stack-based programming language. Implement a very basic evaluator
77
for a small subset of Forth.
88

@@ -24,3 +24,5 @@ more letters, digits, symbols or punctuation that is not a number.
2424
enough.)
2525

2626
Words are case-insensitive.
27+
28+
[Forth]: https://en.wikipedia.org/wiki/Forth_%28programming_language%29

exercises/go-counting/description.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ To be more precise an empty intersection is part of a player's territory
3131
if all of its neighbors are either stones of that player or empty
3232
intersections that are part of that player's territory.
3333

34-
For more information see
35-
[wikipedia](https://en.wikipedia.org/wiki/Go_%28game%29) or [Sensei's
36-
Library](http://senseis.xmp.net/).
34+
For more information see [wikipedia][go-wikipedia] or [Sensei's Library][go-sensei].
35+
36+
[go-wikipedia]: https://en.wikipedia.org/wiki/Go_%28game%29
37+
[go-sensei]: http://senseis.xmp.net/

exercises/grep/description.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Search a file for lines matching a regular expression pattern. Return the line
44
number and contents of each matching line.
55

6-
The Unix [`grep`](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html) command can be used to search for lines in one or more files
6+
The Unix [`grep`][grep] command can be used to search for lines in one or more files
77
that match a user-provided search query (known as the *pattern*).
88

99
The `grep` command takes three arguments:
@@ -75,3 +75,5 @@ The `grep` command should support multiple flags at once.
7575

7676
For example, running `grep -l -v "hello" file1.txt file2.txt` should
7777
print the names of files that do not contain the string "hello".
78+
79+
[grep]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html

0 commit comments

Comments
 (0)