Skip to content

Commit 3abc3f6

Browse files
authored
Merge pull request #979 from petertseng/readme
README updates from problem-specifications
2 parents dd5bddd + c84b3b8 commit 3abc3f6

File tree

12 files changed

+35
-31
lines changed

12 files changed

+35
-31
lines changed

exercises/affine-cipher/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,43 @@
22

33
Create an implementation of the affine cipher,
44
an ancient encryption system created in the Middle East.
5-
5+
66
The affine cipher is a type of monoalphabetic substitution cipher.
77
Each character is mapped to its numeric equivalent, encrypted with
88
a mathematical function and then converted to the letter relating to
99
its new numeric value. Although all monoalphabetic ciphers are weak,
1010
the affine cypher is much stronger than the atbash cipher,
1111
because it has many more keys.
12-
12+
1313
the encryption function is:
14-
14+
1515
`E(x) = (ax + b) mod m`
1616
- where `x` is the letter's index from 0 - length of alphabet - 1
1717
- `m` is the length of the alphabet. For the roman alphabet `m == 26`.
1818
- and `a` and `b` make the key
19-
19+
2020
the decryption function is:
21-
21+
2222
`D(y) = a^-1(y - b) mod m`
2323
- where `y` is the numeric value of an encrypted letter, ie. `y = E(x)`
2424
- it is important to note that `a^-1` is the modular multiplicative inverse
2525
of `a mod m`
2626
- the modular multiplicative inverse of `a` only exists if `a` and `m` are
2727
coprime.
28-
28+
2929
To find the MMI of `a`:
3030

3131
`an mod m = 1`
3232
- where `n` is the modular multiplicative inverse of `a mod m`
3333

3434
More information regarding how to find a Modular Multiplicative Inverse
35-
and what it means can be found [here.](https://en.wikipedia.org/wiki/Modular_multiplicative_inverse)
35+
and what it means can be found [here.](https://en.wikipedia.org/wiki/Modular_multiplicative_inverse)
3636

3737
Because automatic decryption fails if `a` is not coprime to `m` your
3838
program should return status 1 and `"Error: a and m must be coprime."`
3939
if they are not. Otherwise it should encode or decode with the
4040
provided key.
41-
41+
4242
The Caesar (shift) cipher is a simple affine cipher where `a` is 1 and
4343
`b` as the magnitude results in a static displacement of the letters.
4444
This is much less secure than a full implementation of the affine cipher.
@@ -48,7 +48,7 @@ size being 5 letters, and punctuation is excluded. This is to make it
4848
harder to guess things based on word boundaries.
4949

5050
## Examples
51-
51+
5252
- Encoding `test` gives `ybty` with the key a=5 b=7
5353
- Decoding `ybty` gives `test` with the key a=5 b=7
5454
- Decoding `ybty` gives `lqul` with the wrong key a=11 b=7

exercises/grade-school/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ In the end, you should be able to:
1515
as 1, 2, 3, etc., and students within a grade should be sorted
1616
alphabetically by name.
1717
- "Who all is enrolled in school right now?"
18-
- "Grade 1: Anna, Barb, and Charlie. Grade 2: Alex, Peter, and Zoe.
19-
Grade 3…"
18+
- "Let me think. We have
19+
Anna, Barb, and Charlie in grade 1,
20+
Alex, Peter, and Zoe in grade 2
21+
and Jim in grade 5.
22+
So the answer is: Anna, Barb, Charlie, Alex, Peter, Zoe and Jim"
2023

2124
Note that all our students only have one name. (It's a small town, what
2225
do you want?)

exercises/isbn-verifier/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Now, it's even trickier since the check digit of an ISBN-10 may be 'X' (represen
4040
* Generate a valid ISBN-13 from the input ISBN-10 (and maybe verify it again with a derived verifier).
4141

4242
* Generate valid ISBN, maybe even from a given starting ISBN.
43+
4344
## Rust Installation
4445

4546
Refer to the [exercism help page][help-page] for Rust installation and learning

exercises/luhn/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,27 @@ are disallowed.
1919
## Example 1: valid credit card number
2020

2121
```text
22-
4539 1488 0343 6467
22+
4539 3195 0343 6467
2323
```
2424

2525
The first step of the Luhn algorithm is to double every second digit,
2626
starting from the right. We will be doubling
2727

2828
```text
29-
4_3_ 1_8_ 0_4_ 6_6_
29+
4_3_ 3_9_ 0_4_ 6_6_
3030
```
3131

3232
If doubling the number results in a number greater than 9 then subtract 9
3333
from the product. The results of our doubling:
3434

3535
```text
36-
8569 2478 0383 3437
36+
8569 6195 0383 3437
3737
```
3838

3939
Then sum all of the digits:
4040

4141
```text
42-
8+5+6+9+2+4+7+8+0+3+8+3+3+4+3+7 = 80
42+
8+5+6+9+6+1+9+5+0+3+8+3+3+4+3+7 = 80
4343
```
4444

4545
If the sum is evenly divisible by 10, then the number is valid. This number is valid!

exercises/minesweeper/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ In this exercise you have to create some code that counts the number of
1010
mines adjacent to a given empty square and replaces that square with the
1111
count.
1212

13-
The board is a rectangle composed of blank space (' ') characters. A mine
13+
The board is a rectangle composed of blank space (' ') characters. A mine
1414
is represented by an asterisk ('\*') character.
1515

1616
If a given space has no adjacent mines at all, leave that square blank.

exercises/palindrome-products/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A palindromic number is a number that remains the same when its digits are
66
reversed. For example, `121` is a palindromic number but `112` is not.
77

88
Given a range of numbers, find the largest and smallest palindromes which
9-
are products of numbers within that range.
9+
are products of two numbers within that range.
1010

1111
Your solution should return the largest and smallest palindromes, along with the
1212
factors of each within the range. If the largest or smallest palindrome has more

exercises/robot-name/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
9090

9191
## Source
9292

93-
A debugging session with Paul Blackwell at gSchool. [http://gschool.it](http://gschool.it)
93+
A debugging session with Paul Blackwell at gSchool.
9494

9595
## Submitting Incomplete Solutions
9696
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

exercises/scale-generator/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ a "whole step" or "major second" (written as an upper-case "M"). The
4343
diatonic scales are built using only these two intervals between
4444
adjacent notes.
4545

46-
Non-diatonic scales can contain other intervals. An "augmented first"
47-
interval, written "A", has two interceding notes (e.g., from A to C or
48-
Db to E). There are also smaller and larger intervals, but they will not
49-
figure into this exercise.
46+
Non-diatonic scales can contain other intervals. An "augmented second"
47+
interval, written "A", has two interceding notes (e.g., from A to C or Db to E)
48+
or a "whole step" plus a "half step". There are also smaller and larger
49+
intervals, but they will not figure into this exercise.
5050

5151
## Rust Installation
5252

exercises/simple-cipher/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ substitution cipher a little more fault tolerant by providing a source
6161
of randomness and ensuring that the key contains only lowercase letters.
6262

6363
If someone doesn't submit a key at all, generate a truly random key of
64-
at least 100 alphanumeric characters in length.
64+
at least 100 lowercase characters in length.
6565

6666
## Extensions
6767

exercises/simple-linked-list/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
131131

132132
## Source
133133

134-
Inspired by 'Data Structures and Algorithms with Object-Oriented Design Patterns in Ruby', singly linked-lists. [https://web.archive.org/web/20160414064110/http://www.brpreiss.com/books/opus8/](https://web.archive.org/web/20160414064110/http://www.brpreiss.com/books/opus8/)
134+
Inspired by 'Data Structures and Algorithms with Object-Oriented Design Patterns in Ruby', singly linked-lists. [https://web.archive.org/web/20160731005714/http://brpreiss.com/books/opus8/html/page96.html](https://web.archive.org/web/20160731005714/http://brpreiss.com/books/opus8/html/page96.html)
135135

136136
## Submitting Incomplete Solutions
137137
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

0 commit comments

Comments
 (0)