From f60c43b35b825975634f844c0707026ea5718c42 Mon Sep 17 00:00:00 2001 From: Florian Keller Date: Sun, 22 Dec 2019 12:39:16 +0100 Subject: [PATCH] fix: Remove trailing spaces I have confirmed that no JSON version change is needed --- CONTRIBUTING.md | 4 ++-- README.md | 12 ++++++------ bin/check_required_files_present | 4 ++-- exercises/affine-cipher/description.md | 18 +++++++++--------- exercises/darts/canonical-data.json | 8 ++++---- exercises/dominoes/canonical-data.json | 18 +++++++++--------- exercises/dot-dsl/description.md | 6 +++--- exercises/grade-school/description.md | 8 ++++---- exercises/list-ops/description.md | 2 +- .../matching-brackets/canonical-data.json | 4 ++-- exercises/minesweeper/description.md | 2 +- exercises/reverse-string/canonical-data.json | 2 +- exercises/simple-cipher/canonical-data.json | 2 +- exercises/two-fer/description.md | 4 ++-- .../canonical-data.json | 2 +- 15 files changed, 48 insertions(+), 48 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b0e4756da7..5260de0c07 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -187,9 +187,9 @@ needs to be made in the [exercism/problem-specifications repository](https://git not directly to the test suite itself. Find the JSON file for the problem in question. For example, if you want to change -the Clock problem, then look for `exercises/clock/canonical-data.json`. Each +the Clock problem, then look for `exercises/clock/canonical-data.json`. Each change should also bump the version of the test data. For more information, -see the [test data versioning](README.md#test-data-versioning) section of the +see the [test data versioning](README.md#test-data-versioning) section of the README. Submit a pull request with the change. diff --git a/README.md b/README.md index 84d5b7f5fc..06b6af62d6 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ is easier to understand with an example: , "input" : { "firstName" : "Alan", "lastName" : "Smithee" - } + } , "expected" : "ASlmainthee" } , { "comments": @@ -106,7 +106,7 @@ is easier to understand with an example: , "input" : { "firstName" : "HAL", "lastName" : "9000" - } + } , "expected" : { "error": "You should never bar a number" } } ] @@ -150,8 +150,8 @@ Test data should be versioned according to [Semantic Version 2.0](http://semver. #### MAJOR version changes -The MAJOR version should be changed when the test suite is modified in a -fundamentally incompatible way. +The MAJOR version should be changed when the test suite is modified in a +fundamentally incompatible way. There are examples of changes requiring a MAJOR version change: @@ -164,7 +164,7 @@ MAJOR changes should be expected to break even well-behaved test generators. #### MINOR version changes -The MINOR version should change when you add functionality in a backwards-compatible manner, make +The MINOR version should change when you add functionality in a backwards-compatible manner, make non-breaking changes that alter the meaning of the test suite, make previously passing solutions possibly fail, or failing solutions fail at a different spot. @@ -185,7 +185,7 @@ There are examples of changes requiring a PATCH version change: - Regrouping/"Renesting" test cases without changing test case ordering. - Changing descriptions or comments. -- Changing keys' ordering or formatting (would result in an equivalent JSON file). +- Changing keys' ordering or formatting (would result in an equivalent JSON file). PATCH changes would never break well-designed test generators, because the test data remains exactly the same. diff --git a/bin/check_required_files_present b/bin/check_required_files_present index a1908815ea..4114176f24 100755 --- a/bin/check_required_files_present +++ b/bin/check_required_files_present @@ -31,7 +31,7 @@ function check_directory { } -while : +while : do case "$1" in -p | --progress) @@ -41,7 +41,7 @@ do *) check_directory 'exercises' if [ $SHOW_PROGRESS == 'true' ]; then - echo + echo echo Done: $MISSING_FILES files missing. fi if (( $MISSING_FILES > 0 )); then diff --git a/exercises/affine-cipher/description.md b/exercises/affine-cipher/description.md index 05639e9f51..650706d5c0 100644 --- a/exercises/affine-cipher/description.md +++ b/exercises/affine-cipher/description.md @@ -1,42 +1,42 @@ Create an implementation of the affine cipher, an ancient encryption system created in the Middle East. - + The affine cipher is a type of monoalphabetic substitution cipher. 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. Although all monoalphabetic ciphers are weak, the affine cypher is much stronger than the atbash cipher, because it has many more keys. - + the encryption function is: - + `E(x) = (ax + b) mod m` - where `x` is the letter's index from 0 - length of alphabet - 1 - `m` is the length of the alphabet. For the roman alphabet `m == 26`. - and `a` and `b` make the key - + the decryption function is: - + `D(y) = a^-1(y - b) mod m` - where `y` is the numeric value of an encrypted letter, ie. `y = E(x)` - it is important to note that `a^-1` is the modular multiplicative inverse of `a mod m` - the modular multiplicative inverse of `a` only exists if `a` and `m` are coprime. - + To find the MMI of `a`: `an mod m = 1` - where `n` is the modular multiplicative inverse of `a mod m` More information regarding how to find a Modular Multiplicative Inverse -and what it means can be found [here.](https://en.wikipedia.org/wiki/Modular_multiplicative_inverse) +and what it means can be found [here.](https://en.wikipedia.org/wiki/Modular_multiplicative_inverse) Because automatic decryption fails if `a` is not coprime to `m` your program should return status 1 and `"Error: a and m must be coprime."` if they are not. Otherwise it should encode or decode with the provided key. - + The Caesar (shift) cipher is a simple affine cipher where `a` is 1 and `b` as the magnitude results in a static displacement of the letters. This is much less secure than a full implementation of the affine cipher. @@ -46,7 +46,7 @@ size being 5 letters, and punctuation is excluded. This is to make it harder to guess things based on word boundaries. ## Examples - + - Encoding `test` gives `ybty` with the key a=5 b=7 - Decoding `ybty` gives `test` with the key a=5 b=7 - Decoding `ybty` gives `lqul` with the wrong key a=11 b=7 diff --git a/exercises/darts/canonical-data.json b/exercises/darts/canonical-data.json index e03af88558..22e94a52d2 100644 --- a/exercises/darts/canonical-data.json +++ b/exercises/darts/canonical-data.json @@ -85,7 +85,7 @@ "y": 3.5 }, "expected": 5 - }, + }, { "property": "score", "description": "Just outside the middle circle", @@ -94,7 +94,7 @@ "y": -3.6 }, "expected": 1 - }, + }, { "property": "score", "description": "Just within the outer circle", @@ -103,7 +103,7 @@ "y": 7.0 }, "expected": 1 - }, + }, { "property": "score", "description": "Just outside the outer circle", @@ -112,7 +112,7 @@ "y": -7.1 }, "expected": 0 - }, + }, { "property": "score", "description": "Asymmetric position between the inner and middle circles", diff --git a/exercises/dominoes/canonical-data.json b/exercises/dominoes/canonical-data.json index 6943084a68..190ee3ea80 100644 --- a/exercises/dominoes/canonical-data.json +++ b/exercises/dominoes/canonical-data.json @@ -40,7 +40,7 @@ { "description": "empty input = empty output", "property": "canChain", - "input": { + "input": { "dominoes": [] }, "expected": true @@ -48,7 +48,7 @@ { "description": "singleton input = singleton output", "property": "canChain", - "input": { + "input": { "dominoes": [[1, 1]] }, "expected": true @@ -56,7 +56,7 @@ { "description": "singleton that can't be chained", "property": "canChain", - "input": { + "input": { "dominoes": [[1, 2]] }, "expected": false @@ -64,7 +64,7 @@ { "description": "three elements", "property": "canChain", - "input": { + "input": { "dominoes": [[1, 2], [3, 1], [2, 3]] }, "expected": true @@ -72,7 +72,7 @@ { "description": "can reverse dominoes", "property": "canChain", - "input": { + "input": { "dominoes": [[1, 2], [1, 3], [2, 3]] }, "expected": true @@ -80,7 +80,7 @@ { "description": "can't be chained", "property": "canChain", - "input": { + "input": { "dominoes": [[1, 2], [4, 1], [2, 3]] }, "expected": false @@ -95,7 +95,7 @@ "as that is not a sufficient condition." ], "property": "canChain", - "input": { + "input": { "dominoes": [[1, 1], [2, 2]] }, "expected": false @@ -103,7 +103,7 @@ { "description": "disconnected - double loop", "property": "canChain", - "input": { + "input": { "dominoes": [[1, 2], [2, 1], [3, 4], [4, 3]] }, "expected": false @@ -111,7 +111,7 @@ { "description": "disconnected - single isolated", "property": "canChain", - "input": { + "input": { "dominoes": [[1, 2], [2, 3], [3, 1], [4, 4]] }, "expected": false diff --git a/exercises/dot-dsl/description.md b/exercises/dot-dsl/description.md index ee9eb66cfb..2b05590bab 100644 --- a/exercises/dot-dsl/description.md +++ b/exercises/dot-dsl/description.md @@ -1,7 +1,7 @@ A [Domain Specific Language (DSL)](https://en.wikipedia.org/wiki/Domain-specific_language) is a -small language optimized for a specific domain. Since a DSL is -targeted, it can greatly impact productivity/understanding by allowing the +small language optimized for a specific domain. Since a DSL is +targeted, it can greatly impact productivity/understanding by allowing the writer to declare *what* they want rather than *how*. One problem area where they are applied are complex customizations/configurations. @@ -25,7 +25,7 @@ Write a Domain Specific Language similar to the Graphviz dot language. Our DSL is similar to the Graphviz dot language in that our DSL will be used to create graph data structures. However, unlike the DOT Language, our DSL will -be an internal DSL for use only in our language. +be an internal DSL for use only in our language. More information about the difference between internal and external DSLs can be found [here](https://martinfowler.com/bliki/DomainSpecificLanguage.html). diff --git a/exercises/grade-school/description.md b/exercises/grade-school/description.md index 09587d61b6..42f345ce70 100644 --- a/exercises/grade-school/description.md +++ b/exercises/grade-school/description.md @@ -13,12 +13,12 @@ In the end, you should be able to: as 1, 2, 3, etc., and students within a grade should be sorted alphabetically by name. - "Who all is enrolled in school right now?" - - "Let me think. We have - Anna, Barb, and Charlie in grade 1, + - "Let me think. We have + Anna, Barb, and Charlie in grade 1, Alex, Peter, and Zoe in grade 2 - and Jim in grade 5. + and Jim in grade 5. So the answer is: Anna, Barb, Charlie, Alex, Peter, Zoe and Jim" - + Note that all our students only have one name. (It's a small town, what do you want?) diff --git a/exercises/list-ops/description.md b/exercises/list-ops/description.md index 54917fd76b..c546be65e9 100644 --- a/exercises/list-ops/description.md +++ b/exercises/list-ops/description.md @@ -4,7 +4,7 @@ In functional languages list operations like `length`, `map`, and `reduce` are very common. Implement a series of basic list operations, without using existing functions. -The precise number and names of the operations to be implemented will be +The precise number and names of the operations to be implemented will be track dependent to avoid conflicts with existing names, but the general operations you will implement include: diff --git a/exercises/matching-brackets/canonical-data.json b/exercises/matching-brackets/canonical-data.json index 1a9f112dfb..18d729b98b 100644 --- a/exercises/matching-brackets/canonical-data.json +++ b/exercises/matching-brackets/canonical-data.json @@ -121,7 +121,7 @@ "value": "[]]" }, "expected": false - }, + }, { "description": "math expression", "property": "isPaired", @@ -139,4 +139,4 @@ "expected": true } ] -} \ No newline at end of file +} diff --git a/exercises/minesweeper/description.md b/exercises/minesweeper/description.md index 61af9b0136..98583d4d3d 100644 --- a/exercises/minesweeper/description.md +++ b/exercises/minesweeper/description.md @@ -8,7 +8,7 @@ In this exercise you have to create some code that counts the number of mines adjacent to a given empty square and replaces that square with the count. -The board is a rectangle composed of blank space (' ') characters. A mine +The board is a rectangle composed of blank space (' ') characters. A mine is represented by an asterisk ('\*') character. If a given space has no adjacent mines at all, leave that square blank. diff --git a/exercises/reverse-string/canonical-data.json b/exercises/reverse-string/canonical-data.json index 025d3092bd..6d56d59152 100644 --- a/exercises/reverse-string/canonical-data.json +++ b/exercises/reverse-string/canonical-data.json @@ -31,7 +31,7 @@ }, { "description": "a sentence with punctuation", - "property": "reverse", + "property": "reverse", "input": { "value": "I'm hungry!" }, diff --git a/exercises/simple-cipher/canonical-data.json b/exercises/simple-cipher/canonical-data.json index 5fc78ad0e9..2f73aa0455 100644 --- a/exercises/simple-cipher/canonical-data.json +++ b/exercises/simple-cipher/canonical-data.json @@ -87,7 +87,7 @@ "expected": "qayaeaagaciai" }, { - "description": "Can wrap on encode", + "description": "Can wrap on encode", "property": "encode", "input": { "key": "abcdefghij", diff --git a/exercises/two-fer/description.md b/exercises/two-fer/description.md index 3a29112e1d..8e5c6780b5 100644 --- a/exercises/two-fer/description.md +++ b/exercises/two-fer/description.md @@ -16,9 +16,9 @@ One for you, one for me. Here are some examples: -|Name |String to return +|Name |String to return |:-------|:------------------ -|Alice |One for Alice, one for me. +|Alice |One for Alice, one for me. |Bob |One for Bob, one for me. | |One for you, one for me. |Zaphod |One for Zaphod, one for me. diff --git a/exercises/variable-length-quantity/canonical-data.json b/exercises/variable-length-quantity/canonical-data.json index 7fdc4806e2..558ce0fe12 100644 --- a/exercises/variable-length-quantity/canonical-data.json +++ b/exercises/variable-length-quantity/canonical-data.json @@ -220,7 +220,7 @@ "description": "multiple values", "property": "decode", "input": { - "integers": [192, 0, 200, 232, 86, 255, 255, 255, 127, 0, 255, 127, 129, 128, 0] + "integers": [192, 0, 200, 232, 86, 255, 255, 255, 127, 0, 255, 127, 129, 128, 0] }, "expected": [8192, 1193046, 268435455, 0, 16383, 16384] }