Skip to content

Commit 12fd37c

Browse files
authored
Sync exercises (#757)
* Exercise doc updates * Exercise metadata updates * Update anagram test to match canonical data
1 parent 164b213 commit 12fd37c

File tree

18 files changed

+59
-43
lines changed

18 files changed

+59
-43
lines changed

exercises/practice/acronym/.docs/instructions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Punctuation is handled as follows: hyphens are word separators (like whitespace)
1010

1111
For example:
1212

13-
|Input|Output|
14-
|-|-|
15-
|As Soon As Possible|ASAP|
16-
|Liquid-crystal display|LCD|
17-
|Thank George It's Friday!|TGIF|
13+
| Input | Output |
14+
| ------------------------- | ------ |
15+
| As Soon As Possible | ASAP |
16+
| Liquid-crystal display | LCD |
17+
| Thank George It's Friday! | TGIF |

exercises/practice/affine-cipher/.docs/instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The affine cipher is a type of monoalphabetic substitution cipher.
66
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.
77
Although all monoalphabetic ciphers are weak, the affine cipher is much stronger than the atbash cipher, because it has many more keys.
88

9-
[//]: # ( monoalphabetic as spelled by Merriam-Webster, compare to polyalphabetic )
9+
[//]: # " monoalphabetic as spelled by Merriam-Webster, compare to polyalphabetic "
1010

1111
## Encryption
1212

@@ -23,7 +23,7 @@ Where:
2323
For the Roman alphabet `m` is `26`.
2424
- `a` and `b` are integers which make the encryption key
2525

26-
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]).
26+
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]).
2727
In case `a` is not coprime to `m`, your program should indicate that this is an error.
2828
Otherwise it should encrypt or decrypt with the provided key.
2929

exercises/practice/all-your-base/.docs/instructions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ Given a number in base **a**, represented as a sequence of digits, convert it to
1414

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

17-
The number 42, *in base 10*, means:
17+
The number 42, _in base 10_, means:
1818

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

21-
The number 101010, *in base 2*, means:
21+
The number 101010, _in base 2_, means:
2222

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

25-
The number 1120, *in base 3*, means:
25+
The number 1120, _in base 3_, means:
2626

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

2929
I think you got the idea!
3030

31-
*Yes. Those three numbers above are exactly the same. Congratulations!*
31+
_Yes. Those three numbers above are exactly the same. Congratulations!_
3232

3333
[positional-notation]: https://en.wikipedia.org/wiki/Positional_notation

exercises/practice/allergies/.docs/instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ Now, given just that score of 34, your program should be able to say:
2222
- Whether Tom is allergic to any one of those allergens listed above.
2323
- All the allergens Tom is allergic to.
2424

25-
Note: a given score may include allergens **not** listed above (i.e. allergens that score 256, 512, 1024, etc.).
25+
Note: a given score may include allergens **not** listed above (i.e. allergens that score 256, 512, 1024, etc.).
2626
Your program should ignore those components of the score.
2727
For example, if the allergy score is 257, your program should only report the eggs (1) allergy.

exercises/practice/anagram/.meta/tests.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ description = "detects anagrams using case-insensitive possible matches"
4646
[7cc195ad-e3c7-44ee-9fd2-d3c344806a2c]
4747
description = "does not detect an anagram if the original word is repeated"
4848

49+
[630abb71-a94e-4715-8395-179ec1df9f91]
50+
description = "does not detect an anagram if the original word is repeated"
51+
reimplementes = "7cc195ad-e3c7-44ee-9fd2-d3c344806a2c"
52+
4953
[9878a1c9-d6ea-4235-ae51-3ea2befd6842]
5054
description = "anagrams must use all letters exactly once"
5155

exercises/practice/anagram/anagram-test.lisp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
'("cashregister" "Carthorse" "radishes")))))
6060

6161
(test does-not-detect-an-anagram-if-the-original-word-is-repeated
62-
(is (equal nil (anagram:anagrams-for "go" '("go" "Go" "GO")))))
62+
(is (equal nil (anagram:anagrams-for "go" '("goGoGO")))))
6363

6464
(test anagrams-must-use-all-letters-exactly-once
6565
(is (equal nil (anagram:anagrams-for "tapper" '("patter")))))

exercises/practice/armstrong-numbers/.docs/instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ An [Armstrong number][armstrong-number] is a number that is the sum of its own d
55
For example:
66

77
- 9 is an Armstrong number, because `9 = 9^1 = 9`
8-
- 10 is *not* an Armstrong number, because `10 != 1^2 + 0^2 = 1`
8+
- 10 is _not_ an Armstrong number, because `10 != 1^2 + 0^2 = 1`
99
- 153 is an Armstrong number, because: `153 = 1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153`
10-
- 154 is *not* an Armstrong number, because: `154 != 1^3 + 5^3 + 4^3 = 1 + 125 + 64 = 190`
10+
- 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.
1313

exercises/practice/binary-search/.docs/instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Binary search only works when a list has been sorted.
1111

1212
The algorithm looks like this:
1313

14-
- Find the middle element of a *sorted* list and compare it with the item we're looking for.
14+
- Find the middle element of a _sorted_ list and compare it with the item we're looking for.
1515
- If the middle element is our item, then we're done!
1616
- If the middle element is greater than our item, we can eliminate that element and all the elements **after** it.
1717
- If the middle element is less than our item, we can eliminate that element and all the elements **before** it.

exercises/practice/book-store/.docs/instructions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ This would give a total of:
3636

3737
Resulting in:
3838

39-
- 5 × (100% - 25%) * $8 = 5 × $6.00 = $30.00, plus
40-
- 3 × (100% - 10%) * $8 = 3 × $7.20 = $21.60
39+
- 5 × (100% - 25%) × $8 = 5 × $6.00 = $30.00, plus
40+
- 3 × (100% - 10%) × $8 = 3 × $7.20 = $21.60
4141

4242
Which equals $51.60.
4343

@@ -53,8 +53,8 @@ This would give a total of:
5353

5454
Resulting in:
5555

56-
- 4 × (100% - 20%) * $8 = 4 × $6.40 = $25.60, plus
57-
- 4 × (100% - 20%) * $8 = 4 × $6.40 = $25.60
56+
- 4 × (100% - 20%) × $8 = 4 × $6.40 = $25.60, plus
57+
- 4 × (100% - 20%) × $8 = 4 × $6.40 = $25.60
5858

5959
Which equals $51.20.
6060

exercises/practice/darts/.docs/instructions.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Write a function that returns the earned points in a single toss of a Darts game
66

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

9+
![Our dart scoreboard with values from a complete miss to a bullseye](https://assets.exercism.org/images/exercises/darts/darts-scoreboard.svg)
10+
911
- If the dart lands outside the target, player earns no points (0 points).
1012
- If the dart lands in the outer circle of the target, player earns 1 point.
1113
- If the dart lands in the middle circle of the target, player earns 5 points.
@@ -16,8 +18,14 @@ Of course, they are all centered at the same point — that is, the circles are
1618

1719
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.
1820

21+
## Credit
22+
23+
The scoreboard image was created by [habere-et-dispertire][habere-et-dispertire] using [Inkscape][inkscape].
24+
1925
[darts]: https://en.wikipedia.org/wiki/Darts
2026
[darts-target]: https://en.wikipedia.org/wiki/Darts#/media/File:Darts_in_a_dartboard.jpg
2127
[concentric]: https://mathworld.wolfram.com/ConcentricCircles.html
2228
[cartesian-coordinates]: https://www.mathsisfun.com/data/cartesian-coordinates.html
2329
[real-numbers]: https://www.mathsisfun.com/numbers/real-numbers.html
30+
[habere-et-dispertire]: https://exercism.org/profiles/habere-et-dispertire
31+
[inkscape]: https://en.wikipedia.org/wiki/Inkscape

0 commit comments

Comments
 (0)