trackler 2.0.6.37 → 2.0.6.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/common/exercises/difference-of-squares/description.md +6 -9
- data/common/exercises/run-length-encoding/canonical-data.json +59 -50
- data/lib/trackler/version.rb +1 -1
- data/tracks/haskell/README.md +3 -3
- data/tracks/haskell/exercises/binary/src/Binary.hs +1 -1
- data/tracks/haskell/exercises/bob/src/Bob.hs +1 -1
- data/tracks/haskell/exercises/rna-transcription/src/DNA.hs +1 -1
- data/tracks/haskell/exercises/space-age/HINTS.md +1 -1
- data/tracks/haskell/exercises/strain/src/Strain.hs +2 -2
- data/tracks/ocaml/exercises/atbash-cipher/test.ml +1 -1
- data/tracks/ocaml/exercises/luhn/test.ml +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 248c2fada6c072524d6f49e9867d79e3483bd780
|
4
|
+
data.tar.gz: 0c7576bdecdfc841c8ccaf4cb9c39627569ae0b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c7c5fbeaea2f63469a4c077c320754574125757a9da00bbc1ce60373714c902c2d773c7769643d30bcbf50d4eece38aea870ccdd0df2e9b383f90b9090a3071
|
7
|
+
data.tar.gz: 82442653f46de01734769c231a99cc3faae5740620eeaa864b194146412a5f389daee84d46679025b82b7b7adb7fa83cde7accfa2785d3a7924135650ffd3ac0
|
@@ -1,12 +1,9 @@
|
|
1
|
-
The square of the sum of the first ten natural numbers is
|
1
|
+
The square of the sum of the first ten natural numbers is
|
2
|
+
(1 + 2 + ... + 10)² = 55² = 3025.
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
The sum of the squares of the first ten natural numbers is,
|
6
|
-
|
7
|
-
1**2 + 2**2 + ... + 10**2 = 385
|
4
|
+
The sum of the squares of the first ten natural numbers is
|
5
|
+
1² + 2² + ... + 10² = 385.
|
8
6
|
|
9
7
|
Hence the difference between the square of the sum of the first
|
10
|
-
ten natural numbers and the sum of the squares
|
11
|
-
|
12
|
-
3025 - 385 = 2640
|
8
|
+
ten natural numbers and the sum of the squares of the first ten
|
9
|
+
natural numbers is 3025 - 385 = 2640.
|
@@ -1,52 +1,61 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
"
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
2
|
+
"encode": {
|
3
|
+
"description": "run-length encode a string",
|
4
|
+
"cases": [
|
5
|
+
{
|
6
|
+
"description": "empty string",
|
7
|
+
"input": "",
|
8
|
+
"expected": ""
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"description": "single characters only are encoded without count",
|
12
|
+
"input": "XYZ",
|
13
|
+
"expected": "XYZ"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"description": "string with no single characters",
|
17
|
+
"input": "AABBBCCCC",
|
18
|
+
"expected": "2A3B4C"
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"description": "single characters mixed with repeated characters",
|
22
|
+
"input": "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB",
|
23
|
+
"expected": "12WB12W3B24WB"
|
24
|
+
}
|
25
|
+
]
|
26
|
+
},
|
27
|
+
"decode": {
|
28
|
+
"description": "run-length decode a string",
|
29
|
+
"cases": [
|
30
|
+
{
|
31
|
+
"description": "empty string",
|
32
|
+
"input": "",
|
33
|
+
"expected": ""
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"description": "single characters only",
|
37
|
+
"input": "XYZ",
|
38
|
+
"expected": "XYZ"
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"description": "string with no single characters",
|
42
|
+
"input": "2A3B4C",
|
43
|
+
"expected": "AABBBCCCC"
|
44
|
+
},
|
45
|
+
{
|
46
|
+
"description": "single characters with repeated characters",
|
47
|
+
"input": "12WB12W3B24WB",
|
48
|
+
"expected": "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB"
|
49
|
+
}
|
50
|
+
]
|
51
|
+
},
|
52
|
+
"consistency": {
|
53
|
+
"cases": [
|
54
|
+
{
|
55
|
+
"description": "encode followed by decode gives original string",
|
56
|
+
"input": "zzz ZZ zZ",
|
57
|
+
"expected": "zzz ZZ zZ"
|
58
|
+
}
|
59
|
+
]
|
60
|
+
}
|
52
61
|
}
|
data/lib/trackler/version.rb
CHANGED
data/tracks/haskell/README.md
CHANGED
@@ -43,7 +43,7 @@ problem description.
|
|
43
43
|
- If you already have a fix for it you may [write a pull request](#writing-a-pull-request).
|
44
44
|
|
45
45
|
#### Reviewing issues and pull requests
|
46
|
-
If you have a dedicated opinion you are welcome to [write a comment](https://help.github.com/articles/commenting-on-a-pull-request/) for an [issue](https://github.com/exercism/xhaskell/
|
46
|
+
If you have a dedicated opinion you are welcome to [write a comment](https://help.github.com/articles/commenting-on-a-pull-request/) for an [issue](https://github.com/exercism/xhaskell/issues) or a [pull request](https://github.com/exercism/xhaskell/pulls).
|
47
47
|
Please be detailed and include reasons, links or arguments to support your opinion.
|
48
48
|
|
49
49
|
#### Porting exercises
|
@@ -107,10 +107,10 @@ format that has all dependencies and build instructions for an exercise.
|
|
107
107
|
- `test/Tests.hs` is the [test suite](#test-suite).
|
108
108
|
|
109
109
|
### Writing an issue
|
110
|
-
To report a bug you should [create an issue](https://help.github.com/articles/creating-an-issue/) [here](https://github.com/exercism/xhaskell/
|
110
|
+
To report a bug you should [create an issue](https://help.github.com/articles/creating-an-issue/) [here](https://github.com/exercism/xhaskell/issues).
|
111
111
|
|
112
112
|
### Writing a pull request
|
113
|
-
To fix a bug you should [create a pull request from a fork](https://help.github.com/articles/creating-a-pull-request-from-a-fork/) [here](https://github.com/exercism/xhaskell/
|
113
|
+
To fix a bug you should [create a pull request from a fork](https://help.github.com/articles/creating-a-pull-request-from-a-fork/) [here](https://github.com/exercism/xhaskell/pulls). See also [here](https://github.com/exercism/x-common/blob/master/CONTRIBUTING.md#git-basics) for more information.
|
114
114
|
|
115
115
|
### Development Dependencies
|
116
116
|
You should have [Stack](http://docs.haskellstack.org/) installed in your system to make contributing to this repository easier.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
## Hints
|
2
2
|
|
3
3
|
In this exercise, we provided the definition of the
|
4
|
-
[algebric data
|
4
|
+
[algebric data type](http://learnyouahaskell.com/making-our-own-types-and-typeclasses)
|
5
5
|
named `Planet`.
|
6
6
|
You need to implement the `ageOn` function, that calculates how many
|
7
7
|
years old someone would be on a `Planet`, given an age in seconds.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Strain (keep, discard) where
|
2
2
|
|
3
3
|
discard :: (a -> Bool) -> [a] -> [a]
|
4
|
-
discard = error "You need to implement this function."
|
4
|
+
discard p xs = error "You need to implement this function."
|
5
5
|
|
6
6
|
keep :: (a -> Bool) -> [a] -> [a]
|
7
|
-
keep = error "You need to implement this function."
|
7
|
+
keep p xs = error "You need to implement this function."
|
@@ -35,7 +35,7 @@ let decode_tests = [
|
|
35
35
|
]
|
36
36
|
|
37
37
|
let different_block_size_test = [
|
38
|
-
"encode mindblowingly with a different block size">::
|
38
|
+
"encode mindblowingly with a different block size" >::
|
39
39
|
ae "n r m w y o l d r m t o b" (encode ~block_size:1 "mindblowingly");
|
40
40
|
]
|
41
41
|
|
@@ -10,6 +10,8 @@ let tests = [
|
|
10
10
|
assert_valid false "1";
|
11
11
|
"A single zero is invalid" >::
|
12
12
|
assert_valid false "0";
|
13
|
+
"simple valid sin" >::
|
14
|
+
assert_valid true " 5 9 ";
|
13
15
|
"valid Canadian SIN" >::
|
14
16
|
assert_valid true "046 454 286";
|
15
17
|
"invalid Canadian SIN" >::
|
@@ -18,6 +20,18 @@ let tests = [
|
|
18
20
|
assert_valid false "8273 1232 7352 0569";
|
19
21
|
"valid strings with a non-digit added become invalid" >::
|
20
22
|
assert_valid false "046a 454 286";
|
23
|
+
"punctuation is not allowed" >::
|
24
|
+
assert_valid false "055-444-285";
|
25
|
+
"symbols are not allowed" >::
|
26
|
+
assert_valid false "055\194\163 444$ 285";
|
27
|
+
"single zero with space is invalid" >::
|
28
|
+
assert_valid false " 0";
|
29
|
+
"lots of zeros are valid" >::
|
30
|
+
assert_valid true " 00000";
|
31
|
+
"another valid sin" >::
|
32
|
+
assert_valid true "055 444 285";
|
33
|
+
"nine doubled is nine" >::
|
34
|
+
assert_valid true "091";
|
21
35
|
]
|
22
36
|
|
23
37
|
let () =
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trackler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.6.
|
4
|
+
version: 2.0.6.38
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katrina Owen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|