Skip to content

Commit 3422fdf

Browse files
authored
Update all exercises with upstream (#1736)
1 parent 565c881 commit 3422fdf

File tree

86 files changed

+907
-384
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+907
-384
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/acronym/.meta/tests.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,9 @@ description = "very long abbreviation"
2929

3030
[6a078f49-c68d-4b7b-89af-33a1a98c28cc]
3131
description = "consecutive delimiters"
32+
33+
[5118b4b1-4572-434c-8d57-5b762e57973e]
34+
description = "apostrophes"
35+
36+
[adc12eab-ec2d-414f-b48c-66a4fc06cdef]
37+
description = "underscore emphasis"

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Create an implementation of the affine cipher, an ancient encryption system crea
44

55
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.
7-
Although all monoalphabetic ciphers are weak, the affine cipher is much stronger than the atbash cipher, because it has many more keys.
7+
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

@@ -18,12 +18,12 @@ E(x) = (ai + b) mod m
1818

1919
Where:
2020

21-
- `i` is the letter's index from `0` to the length of the alphabet - 1
21+
- `i` is the letter's index from `0` to the length of the alphabet - 1.
2222
- `m` is the length of the alphabet.
2323
For the Roman alphabet `m` is `26`.
24-
- `a` and `b` are integers which make the encryption key
24+
- `a` and `b` are integers which make up 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/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/alphametics/.docs/instructions.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Instructions
22

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

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

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

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

29-
Write a function to solve alphametics puzzles.
30-
3129
[alphametics]: https://en.wikipedia.org/wiki/Alphametics

exercises/practice/alphametics/.meta/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@
2727
".meta/example.rb"
2828
]
2929
},
30-
"blurb": "Write a function to solve alphametics puzzles."
30+
"blurb": "Given an alphametics puzzle, find the correct solution."
3131
}

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ description = "detects anagrams using case-insensitive possible matches"
4646

4747
[7cc195ad-e3c7-44ee-9fd2-d3c344806a2c]
4848
description = "does not detect an anagram if the original word is repeated"
49+
include = false
50+
51+
[630abb71-a94e-4715-8395-179ec1df9f91]
52+
description = "does not detect an anagram if the original word is repeated"
53+
reimplements = "7cc195ad-e3c7-44ee-9fd2-d3c344806a2c"
4954

5055
[9878a1c9-d6ea-4235-ae51-3ea2befd6842]
5156
description = "anagrams must use all letters exactly once"
@@ -73,3 +78,9 @@ include = false
7378
[33d3f67e-fbb9-49d3-a90e-0beb00861da7]
7479
description = "words other than themselves can be anagrams"
7580
reimplements = "a0705568-628c-4b55-9798-82e4acde51ca"
81+
82+
[a6854f66-eec1-4afd-a137-62ef2870c051]
83+
description = "handles case of greek letters"
84+
85+
[fd3509e5-e3ba-409d-ac3d-a9ac84d13296]
86+
description = "different characters may have the same bytes"

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/atbash-cipher/.docs/instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Instructions
22

3-
Create an implementation of the atbash cipher, an ancient encryption system created in the Middle East.
3+
Create an implementation of the Atbash cipher, an ancient encryption system created in the Middle East.
44

55
The Atbash cipher is a simple substitution cipher that relies on transposing all the letters in the alphabet such that the resulting alphabet is backwards.
66
The first letter is replaced with the last letter, the second with the second-last, and so on.

exercises/practice/atbash-cipher/.meta/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
".meta/example.rb"
2525
]
2626
},
27-
"blurb": "Create an implementation of the atbash cipher, an ancient encryption system created in the Middle East.",
27+
"blurb": "Create an implementation of the Atbash cipher, an ancient encryption system created in the Middle East.",
2828
"source": "Wikipedia",
2929
"source_url": "https://en.wikipedia.org/wiki/Atbash"
3030
}

0 commit comments

Comments
 (0)