trackler 2.2.1.58 → 2.2.1.59

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/exercises/isbn-verifier/canonical-data.json +3 -3
  4. data/tracks/c/docs/C_STYLE_GUIDE.md +23 -0
  5. data/tracks/erlang/config.json +10 -0
  6. data/tracks/erlang/exercises/custom-set/README.md +54 -0
  7. data/tracks/erlang/exercises/custom-set/include/exercism.hrl +11 -0
  8. data/tracks/erlang/exercises/custom-set/rebar.config +30 -0
  9. data/tracks/erlang/exercises/custom-set/src/custom_set.app.src +9 -0
  10. data/tracks/erlang/exercises/custom-set/src/custom_set.erl +27 -0
  11. data/tracks/erlang/exercises/custom-set/src/example.erl +51 -0
  12. data/tracks/erlang/exercises/custom-set/test/custom_set_tests.erl +188 -0
  13. data/tracks/erlang/testgen/src/tgen_custom-set.erl +98 -0
  14. data/tracks/haskell/config.json +11 -0
  15. data/tracks/haskell/exercises/perfect-numbers/README.md +78 -0
  16. data/tracks/haskell/exercises/perfect-numbers/examples/success-standard/package.yaml +16 -0
  17. data/tracks/haskell/exercises/perfect-numbers/examples/success-standard/src/PerfectNumbers.hs +10 -0
  18. data/tracks/haskell/exercises/perfect-numbers/package.yaml +20 -0
  19. data/tracks/haskell/exercises/perfect-numbers/src/PerfectNumbers.hs +6 -0
  20. data/tracks/haskell/exercises/perfect-numbers/stack.yaml +1 -0
  21. data/tracks/haskell/exercises/perfect-numbers/test/Tests.hs +79 -0
  22. data/tracks/javascript/exercises/acronym/README.md +1 -1
  23. data/tracks/javascript/exercises/all-your-base/README.md +1 -1
  24. data/tracks/javascript/exercises/allergies/README.md +1 -1
  25. data/tracks/javascript/exercises/alphametics/README.md +1 -1
  26. data/tracks/javascript/exercises/anagram/README.md +1 -1
  27. data/tracks/javascript/exercises/atbash-cipher/README.md +1 -1
  28. data/tracks/javascript/exercises/beer-song/README.md +1 -1
  29. data/tracks/javascript/exercises/binary-search-tree/README.md +1 -1
  30. data/tracks/javascript/exercises/binary-search/README.md +1 -1
  31. data/tracks/javascript/exercises/binary/README.md +1 -1
  32. data/tracks/javascript/exercises/bob/README.md +1 -1
  33. data/tracks/javascript/exercises/bowling/README.md +1 -1
  34. data/tracks/javascript/exercises/bracket-push/README.md +1 -1
  35. data/tracks/javascript/exercises/change/README.md +1 -1
  36. data/tracks/javascript/exercises/circular-buffer/README.md +1 -1
  37. data/tracks/javascript/exercises/clock/README.md +1 -1
  38. data/tracks/javascript/exercises/collatz-conjecture/README.md +1 -1
  39. data/tracks/javascript/exercises/crypto-square/README.md +1 -1
  40. data/tracks/javascript/exercises/custom-set/README.md +1 -1
  41. data/tracks/javascript/exercises/diamond/README.md +1 -1
  42. data/tracks/javascript/exercises/difference-of-squares/README.md +1 -1
  43. data/tracks/javascript/exercises/diffie-hellman/README.md +1 -1
  44. data/tracks/javascript/exercises/etl/README.md +1 -1
  45. data/tracks/javascript/exercises/flatten-array/README.md +1 -1
  46. data/tracks/javascript/exercises/food-chain/README.md +1 -1
  47. data/tracks/javascript/exercises/gigasecond/README.md +1 -1
  48. data/tracks/javascript/exercises/grade-school/README.md +1 -1
  49. data/tracks/javascript/exercises/grains/README.md +1 -1
  50. data/tracks/javascript/exercises/hamming/README.md +1 -1
  51. data/tracks/javascript/exercises/hello-world/README.md +1 -1
  52. data/tracks/javascript/exercises/hexadecimal/README.md +1 -1
  53. data/tracks/javascript/exercises/isogram/README.md +1 -1
  54. data/tracks/javascript/exercises/kindergarten-garden/README.md +1 -1
  55. data/tracks/javascript/exercises/largest-series-product/README.md +1 -1
  56. data/tracks/javascript/exercises/leap/README.md +1 -1
  57. data/tracks/javascript/exercises/linked-list/README.md +1 -1
  58. data/tracks/javascript/exercises/list-ops/README.md +1 -1
  59. data/tracks/javascript/exercises/luhn/README.md +1 -1
  60. data/tracks/javascript/exercises/matrix/README.md +1 -1
  61. data/tracks/javascript/exercises/meetup/README.md +1 -1
  62. data/tracks/javascript/exercises/minesweeper/README.md +1 -1
  63. data/tracks/javascript/exercises/nth-prime/README.md +1 -1
  64. data/tracks/javascript/exercises/nucleotide-count/README.md +1 -1
  65. data/tracks/javascript/exercises/ocr-numbers/README.md +1 -1
  66. data/tracks/javascript/exercises/octal/README.md +1 -1
  67. data/tracks/javascript/exercises/palindrome-products/README.md +1 -1
  68. data/tracks/javascript/exercises/pangram/README.md +1 -1
  69. data/tracks/javascript/exercises/pascals-triangle/README.md +1 -1
  70. data/tracks/javascript/exercises/perfect-numbers/README.md +1 -1
  71. data/tracks/javascript/exercises/phone-number/README.md +1 -1
  72. data/tracks/javascript/exercises/pig-latin/README.md +1 -1
  73. data/tracks/javascript/exercises/point-mutations/README.md +1 -1
  74. data/tracks/javascript/exercises/prime-factors/README.md +1 -1
  75. data/tracks/javascript/exercises/protein-translation/README.md +1 -1
  76. data/tracks/javascript/exercises/proverb/README.md +1 -1
  77. data/tracks/javascript/exercises/pythagorean-triplet/README.md +1 -1
  78. data/tracks/javascript/exercises/queen-attack/README.md +1 -1
  79. data/tracks/javascript/exercises/raindrops/README.md +1 -1
  80. data/tracks/javascript/exercises/rna-transcription/README.md +1 -1
  81. data/tracks/javascript/exercises/robot-name/README.md +1 -1
  82. data/tracks/javascript/exercises/robot-simulator/README.md +1 -1
  83. data/tracks/javascript/exercises/roman-numerals/README.md +1 -1
  84. data/tracks/javascript/exercises/run-length-encoding/README.md +1 -1
  85. data/tracks/javascript/exercises/saddle-points/README.md +1 -1
  86. data/tracks/javascript/exercises/say/README.md +1 -1
  87. data/tracks/javascript/exercises/scrabble-score/README.md +1 -1
  88. data/tracks/javascript/exercises/secret-handshake/README.md +1 -1
  89. data/tracks/javascript/exercises/series/README.md +1 -1
  90. data/tracks/javascript/exercises/sieve/README.md +1 -1
  91. data/tracks/javascript/exercises/simple-cipher/README.md +1 -1
  92. data/tracks/javascript/exercises/simple-linked-list/README.md +1 -1
  93. data/tracks/javascript/exercises/space-age/README.md +1 -1
  94. data/tracks/javascript/exercises/strain/README.md +1 -1
  95. data/tracks/javascript/exercises/sum-of-multiples/README.md +1 -1
  96. data/tracks/javascript/exercises/transpose/README.md +1 -1
  97. data/tracks/javascript/exercises/triangle/README.md +1 -1
  98. data/tracks/javascript/exercises/trinary/README.md +1 -1
  99. data/tracks/javascript/exercises/twelve-days/README.md +1 -1
  100. data/tracks/javascript/exercises/two-bucket/README.md +1 -1
  101. data/tracks/javascript/exercises/word-count/README.md +1 -1
  102. data/tracks/javascript/exercises/wordy/README.md +1 -1
  103. data/tracks/javascript/exercises/zipper/README.md +1 -1
  104. data/tracks/typescript/config.json +15 -1
  105. data/tracks/typescript/exercises/pythagorean-triplet/README.md +54 -0
  106. data/tracks/typescript/exercises/pythagorean-triplet/package.json +36 -0
  107. data/tracks/typescript/exercises/pythagorean-triplet/pythagorean-triplet.example.ts +60 -0
  108. data/tracks/typescript/exercises/pythagorean-triplet/pythagorean-triplet.test.ts +37 -0
  109. data/tracks/typescript/exercises/pythagorean-triplet/pythagorean-triplet.ts +0 -0
  110. data/tracks/typescript/exercises/pythagorean-triplet/tsconfig.json +22 -0
  111. data/tracks/typescript/exercises/pythagorean-triplet/tslint.json +127 -0
  112. data/tracks/typescript/exercises/pythagorean-triplet/yarn.lock +2624 -0
  113. metadata +25 -2
@@ -22,7 +22,7 @@ Find the product a * b * c.
22
22
  Go through the setup instructions for JavaScript to
23
23
  install the necessary dependencies:
24
24
 
25
- http://exercism.io/languages/javascript
25
+ http://exercism.io/languages/javascript/installation
26
26
 
27
27
  ## Making the Test Suite Pass
28
28
 
@@ -31,7 +31,7 @@ share a diagonal.
31
31
  Go through the setup instructions for JavaScript to
32
32
  install the necessary dependencies:
33
33
 
34
- http://exercism.io/languages/javascript
34
+ http://exercism.io/languages/javascript/installation
35
35
 
36
36
  ## Making the Test Suite Pass
37
37
 
@@ -22,7 +22,7 @@ Convert a number to a string, the contents of which depend on the number's facto
22
22
  Go through the setup instructions for JavaScript to
23
23
  install the necessary dependencies:
24
24
 
25
- http://exercism.io/languages/javascript
25
+ http://exercism.io/languages/javascript/installation
26
26
 
27
27
  ## Making the Test Suite Pass
28
28
 
@@ -23,7 +23,7 @@ each nucleotide with its complement:
23
23
  Go through the setup instructions for JavaScript to
24
24
  install the necessary dependencies:
25
25
 
26
- http://exercism.io/languages/javascript
26
+ http://exercism.io/languages/javascript/installation
27
27
 
28
28
  ## Making the Test Suite Pass
29
29
 
@@ -20,7 +20,7 @@ every existing robot has a unique name.
20
20
  Go through the setup instructions for JavaScript to
21
21
  install the necessary dependencies:
22
22
 
23
- http://exercism.io/languages/javascript
23
+ http://exercism.io/languages/javascript/installation
24
24
 
25
25
  ## Making the Test Suite Pass
26
26
 
@@ -32,7 +32,7 @@ direction it is pointing.
32
32
  Go through the setup instructions for JavaScript to
33
33
  install the necessary dependencies:
34
34
 
35
- http://exercism.io/languages/javascript
35
+ http://exercism.io/languages/javascript/installation
36
36
 
37
37
  ## Making the Test Suite Pass
38
38
 
@@ -47,7 +47,7 @@ See also: http://www.novaroma.org/via_romana/numbers.html
47
47
  Go through the setup instructions for JavaScript to
48
48
  install the necessary dependencies:
49
49
 
50
- http://exercism.io/languages/javascript
50
+ http://exercism.io/languages/javascript/installation
51
51
 
52
52
  ## Making the Test Suite Pass
53
53
 
@@ -28,7 +28,7 @@ be decoded always represent the count for the following character.
28
28
  Go through the setup instructions for JavaScript to
29
29
  install the necessary dependencies:
30
30
 
31
- http://exercism.io/languages/javascript
31
+ http://exercism.io/languages/javascript/installation
32
32
 
33
33
  ## Making the Test Suite Pass
34
34
 
@@ -31,7 +31,7 @@ but the tests for this exercise follow the above unambiguous definition.
31
31
  Go through the setup instructions for JavaScript to
32
32
  install the necessary dependencies:
33
33
 
34
- http://exercism.io/languages/javascript
34
+ http://exercism.io/languages/javascript/installation
35
35
 
36
36
  ## Making the Test Suite Pass
37
37
 
@@ -67,7 +67,7 @@ Use _and_ (correctly) when spelling out the number in English:
67
67
  Go through the setup instructions for JavaScript to
68
68
  install the necessary dependencies:
69
69
 
70
- http://exercism.io/languages/javascript
70
+ http://exercism.io/languages/javascript/installation
71
71
 
72
72
  ## Making the Test Suite Pass
73
73
 
@@ -42,7 +42,7 @@ And to total:
42
42
  Go through the setup instructions for JavaScript to
43
43
  install the necessary dependencies:
44
44
 
45
- http://exercism.io/languages/javascript
45
+ http://exercism.io/languages/javascript/installation
46
46
 
47
47
  ## Making the Test Suite Pass
48
48
 
@@ -33,7 +33,7 @@ has caused the array to be reversed.
33
33
  Go through the setup instructions for JavaScript to
34
34
  install the necessary dependencies:
35
35
 
36
- http://exercism.io/languages/javascript
36
+ http://exercism.io/languages/javascript/installation
37
37
 
38
38
  ## Making the Test Suite Pass
39
39
 
@@ -25,7 +25,7 @@ in the input; the digits need not be *numerically consecutive*.
25
25
  Go through the setup instructions for JavaScript to
26
26
  install the necessary dependencies:
27
27
 
28
- http://exercism.io/languages/javascript
28
+ http://exercism.io/languages/javascript/installation
29
29
 
30
30
  ## Making the Test Suite Pass
31
31
 
@@ -32,7 +32,7 @@ correct list of primes.
32
32
  Go through the setup instructions for JavaScript to
33
33
  install the necessary dependencies:
34
34
 
35
- http://exercism.io/languages/javascript
35
+ http://exercism.io/languages/javascript/installation
36
36
 
37
37
  ## Making the Test Suite Pass
38
38
 
@@ -88,7 +88,7 @@ on Wikipedia][dh] for one of the first implementations of this scheme.
88
88
  Go through the setup instructions for JavaScript to
89
89
  install the necessary dependencies:
90
90
 
91
- http://exercism.io/languages/javascript
91
+ http://exercism.io/languages/javascript/installation
92
92
 
93
93
  ## Making the Test Suite Pass
94
94
 
@@ -26,7 +26,7 @@ implement your own abstract data type.
26
26
  Go through the setup instructions for JavaScript to
27
27
  install the necessary dependencies:
28
28
 
29
- http://exercism.io/languages/javascript
29
+ http://exercism.io/languages/javascript/installation
30
30
 
31
31
  ## Making the Test Suite Pass
32
32
 
@@ -22,7 +22,7 @@ youtube video](http://www.youtube.com/watch?v=Z_2gbGXzFbs).
22
22
  Go through the setup instructions for JavaScript to
23
23
  install the necessary dependencies:
24
24
 
25
- http://exercism.io/languages/javascript
25
+ http://exercism.io/languages/javascript/installation
26
26
 
27
27
  ## Making the Test Suite Pass
28
28
 
@@ -38,7 +38,7 @@ basic tools instead.
38
38
  Go through the setup instructions for JavaScript to
39
39
  install the necessary dependencies:
40
40
 
41
- http://exercism.io/languages/javascript
41
+ http://exercism.io/languages/javascript/installation
42
42
 
43
43
  ## Making the Test Suite Pass
44
44
 
@@ -16,7 +16,7 @@ up to but not including that number.
16
16
  Go through the setup instructions for JavaScript to
17
17
  install the necessary dependencies:
18
18
 
19
- http://exercism.io/languages/javascript
19
+ http://exercism.io/languages/javascript/installation
20
20
 
21
21
  ## Making the Test Suite Pass
22
22
 
@@ -63,7 +63,7 @@ the corresponding output row should contain the spaces in its right-most column(
63
63
  Go through the setup instructions for JavaScript to
64
64
  install the necessary dependencies:
65
65
 
66
- http://exercism.io/languages/javascript
66
+ http://exercism.io/languages/javascript/installation
67
67
 
68
68
  ## Making the Test Suite Pass
69
69
 
@@ -24,7 +24,7 @@ a single line. Feel free to add your own code/tests to check for degenerate tria
24
24
  Go through the setup instructions for JavaScript to
25
25
  install the necessary dependencies:
26
26
 
27
- http://exercism.io/languages/javascript
27
+ http://exercism.io/languages/javascript/installation
28
28
 
29
29
  ## Making the Test Suite Pass
30
30
 
@@ -26,7 +26,7 @@ conversion, pretend it doesn't exist and implement it yourself.
26
26
  Go through the setup instructions for JavaScript to
27
27
  install the necessary dependencies:
28
28
 
29
- http://exercism.io/languages/javascript
29
+ http://exercism.io/languages/javascript/installation
30
30
 
31
31
  ## Making the Test Suite Pass
32
32
 
@@ -34,7 +34,7 @@ On the twelfth day of Christmas my true love gave to me, twelve Drummers Drummin
34
34
  Go through the setup instructions for JavaScript to
35
35
  install the necessary dependencies:
36
36
 
37
- http://exercism.io/languages/javascript
37
+ http://exercism.io/languages/javascript/installation
38
38
 
39
39
  ## Making the test suite pass
40
40
 
@@ -34,7 +34,7 @@ Written with <3 at [Fullstack Academy](http://www.fullstackacademy.com/) by [Lin
34
34
  Go through the setup instructions for JavaScript to
35
35
  install the necessary dependencies:
36
36
 
37
- http://exercism.io/languages/javascript
37
+ http://exercism.io/languages/javascript/installation
38
38
 
39
39
  ## Making the Test Suite Pass
40
40
 
@@ -17,7 +17,7 @@ free: 1
17
17
  Go through the setup instructions for JavaScript to
18
18
  install the necessary dependencies:
19
19
 
20
- http://exercism.io/languages/javascript
20
+ http://exercism.io/languages/javascript/installation
21
21
 
22
22
  ## Making the Test Suite Pass
23
23
 
@@ -61,7 +61,7 @@ If you'd like, handle exponentials.
61
61
  Go through the setup instructions for JavaScript to
62
62
  install the necessary dependencies:
63
63
 
64
- http://exercism.io/languages/javascript
64
+ http://exercism.io/languages/javascript/installation
65
65
 
66
66
  ## Making the Test Suite Pass
67
67
 
@@ -32,7 +32,7 @@ list of child nodes) a zipper might support these operations:
32
32
  Go through the setup instructions for JavaScript to
33
33
  install the necessary dependencies:
34
34
 
35
- http://exercism.io/languages/javascript
35
+ http://exercism.io/languages/javascript/installation
36
36
 
37
37
  ## Making the Test Suite Pass
38
38
 
@@ -480,6 +480,20 @@
480
480
  "unlocked_by": "wordy",
481
481
  "uuid": "abe907d0-7ca0-4fe5-83fd-72a4d2acab66"
482
482
  },
483
+ {
484
+ "uuid": "85d74be3-8a54-4355-9ef8-0f13ed2a7683",
485
+ "slug": "pythagorean-triplet",
486
+ "core": false,
487
+ "unlocked_by": "space-age",
488
+ "difficulty": 5,
489
+ "topics": [
490
+ "control_flow_conditionals",
491
+ "control_flow_loops",
492
+ "algorithms",
493
+ "mathematics",
494
+ "integers"
495
+ ]
496
+ },
483
497
  {
484
498
  "core": false,
485
499
  "difficulty": 5,
@@ -500,4 +514,4 @@
500
514
  "foregone": [],
501
515
  "language": "TypeScript",
502
516
  "test_pattern": ".*[.]test[.]ts$"
503
- }
517
+ }
@@ -0,0 +1,54 @@
1
+ # Pythagorean Triplet
2
+
3
+ A Pythagorean triplet is a set of three natural numbers, {a, b, c}, for
4
+ which,
5
+
6
+ ```
7
+ a**2 + b**2 = c**2
8
+ ```
9
+
10
+ For example,
11
+
12
+ ```
13
+ 3**2 + 4**2 = 9 + 16 = 25 = 5**2.
14
+ ```
15
+
16
+ There exists exactly one Pythagorean triplet for which a + b + c = 1000.
17
+
18
+ Find the product a * b * c.
19
+
20
+ ## Setup
21
+
22
+ Go through the setup instructions for TypeScript to
23
+ install the necessary dependencies:
24
+
25
+ http://exercism.io/languages/typescript
26
+
27
+ ## Requirements
28
+
29
+ Install assignment dependencies:
30
+
31
+ ```bash
32
+ $ yarn install
33
+ ```
34
+
35
+ ## Making the test suite pass
36
+
37
+ Execute the tests with:
38
+
39
+ ```bash
40
+ $ yarn test
41
+ ```
42
+
43
+ In the test suites all tests but the first have been skipped.
44
+
45
+ Once you get a test passing, you can enable the next one by
46
+ changing `xit` to `it`.
47
+
48
+
49
+ ## Source
50
+
51
+ Problem 9 at Project Euler [http://projecteuler.net/problem=9](http://projecteuler.net/problem=9)
52
+
53
+ ## Submitting Incomplete Solutions
54
+ It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "xtypescript",
3
+ "version": "1.0.0",
4
+ "description": "Exercism exercises in Typescript.",
5
+ "author": "",
6
+ "private": true,
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/exercism/xtypescript"
10
+ },
11
+ "devDependencies": {},
12
+ "scripts": {
13
+ "test": "tsc --noEmit -p . && jest --no-cache",
14
+ "lint": "tsc --noEmit -p . && tslint \"*.ts?(x)\"",
15
+ "lintci": "tslint \"*.ts?(x)\" --force"
16
+ },
17
+ "dependencies": {
18
+ "@types/jest": "^21.1.5",
19
+ "@types/node": "^8.0.47",
20
+ "jest": "^21.2.1",
21
+ "ts-jest": "^21.1.3",
22
+ "tslint": "^5.8.0",
23
+ "typescript": "^2.5.3"
24
+ },
25
+ "jest": {
26
+ "transform": {
27
+ ".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
28
+ },
29
+ "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
30
+ "moduleFileExtensions": [
31
+ "ts",
32
+ "tsx",
33
+ "js"
34
+ ]
35
+ }
36
+ }
@@ -0,0 +1,60 @@
1
+ export default class Triplet {
2
+
3
+ a: number
4
+ b: number
5
+ c: number
6
+
7
+ constructor(a: number, b: number, c: number) {
8
+ this.a = a
9
+ this.b = b
10
+ this.c = c
11
+ }
12
+
13
+ isPythagorean() {
14
+ return this.a * this.a + this.b * this.b === this.c * this.c
15
+ }
16
+
17
+ sum() {
18
+ return this.a + this.b + this.c
19
+ }
20
+
21
+ product() {
22
+ return this.a * this.b * this.c
23
+ }
24
+
25
+ static where(maxFactor: number, minFactor?: number, sum?: number) {
26
+ return new Triplets(maxFactor, minFactor, sum).toArray()
27
+ }
28
+ }
29
+
30
+ class Triplets {
31
+
32
+ min: number
33
+ max: number
34
+ sum?: number
35
+
36
+ constructor(maxFactor: number, minFactor: number = 1, sum?: number) {
37
+ this.max = maxFactor
38
+ this.min = minFactor
39
+ this.sum = sum
40
+ }
41
+
42
+ toArray() {
43
+ const triplets = []
44
+ for (let a = this.min; a < this.max - 1; a++) {
45
+ for (let b = a + 1; b < this.max; b++) {
46
+ for (let c = b + 1; c <= this.max; c++) {
47
+ const triplet = new Triplet(a, b, c)
48
+ if (this.isDesired(triplet)) {
49
+ triplets.push(triplet)
50
+ }
51
+ }
52
+ }
53
+ }
54
+ return triplets
55
+ }
56
+
57
+ isDesired(triplet: Triplet) {
58
+ return triplet.isPythagorean() && (!this.sum || triplet.sum() === this.sum)
59
+ }
60
+ }