trackler 2.2.1.125 → 2.2.1.126

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.
Files changed (40) 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 +2 -2
  4. data/tracks/erlang/README.md +5 -5
  5. data/tracks/erlang/config.json +10 -0
  6. data/tracks/erlang/docs/INSTALLATION.md +1 -1
  7. data/tracks/erlang/exercises/isbn-verifier/README.md +80 -0
  8. data/tracks/erlang/exercises/isbn-verifier/rebar.config +30 -0
  9. data/tracks/erlang/exercises/isbn-verifier/src/example.erl +13 -0
  10. data/tracks/erlang/exercises/isbn-verifier/src/isbn_verifier.app.src +9 -0
  11. data/tracks/erlang/exercises/isbn-verifier/src/isbn_verifier.erl +7 -0
  12. data/tracks/erlang/exercises/isbn-verifier/test/isbn_verifier_tests.erl +48 -0
  13. data/tracks/haskell/exercises/isbn-verifier/package.yaml +1 -1
  14. data/tracks/haskell/exercises/isbn-verifier/test/Tests.hs +1 -1
  15. data/tracks/javascript/.eslintignore +0 -1
  16. data/tracks/javascript/exercises/robot-simulator/example.js +70 -72
  17. data/tracks/typescript/config.json +34 -2
  18. data/tracks/typescript/exercises/all-your-base/README.md +60 -0
  19. data/tracks/typescript/exercises/all-your-base/all-your-base.example.ts +53 -0
  20. data/tracks/typescript/exercises/all-your-base/all-your-base.test.ts +119 -0
  21. data/tracks/typescript/exercises/all-your-base/all-your-base.ts +0 -0
  22. data/tracks/typescript/exercises/all-your-base/package.json +36 -0
  23. data/tracks/typescript/exercises/all-your-base/tsconfig.json +22 -0
  24. data/tracks/typescript/exercises/all-your-base/tslint.json +127 -0
  25. data/tracks/typescript/exercises/all-your-base/yarn.lock +2624 -0
  26. data/tracks/typescript/exercises/anagram/anagram.example.ts +3 -3
  27. data/tracks/typescript/exercises/anagram/anagram.test.ts +55 -57
  28. data/tracks/typescript/exercises/anagram/anagram.ts +0 -5
  29. data/tracks/typescript/exercises/crypto-square/README.md +102 -0
  30. data/tracks/typescript/exercises/crypto-square/crypto-square.example.ts +59 -0
  31. data/tracks/typescript/exercises/crypto-square/crypto-square.test.ts +53 -0
  32. data/tracks/typescript/exercises/crypto-square/crypto-square.ts +0 -0
  33. data/tracks/typescript/exercises/crypto-square/package.json +36 -0
  34. data/tracks/typescript/exercises/crypto-square/tsconfig.json +22 -0
  35. data/tracks/typescript/exercises/crypto-square/tslint.json +127 -0
  36. data/tracks/typescript/exercises/crypto-square/yarn.lock +2624 -0
  37. data/tracks/typescript/exercises/kindergarten-garden/kindergarten-garden.example.ts +40 -40
  38. data/tracks/typescript/exercises/kindergarten-garden/kindergarten-garden.test.ts +118 -118
  39. data/tracks/typescript/exercises/kindergarten-garden/kindergarten-garden.ts +0 -7
  40. metadata +24 -2
@@ -1,64 +1,64 @@
1
1
  const defaultChildren = [
2
- 'Alice',
3
- 'Bob',
4
- 'Charlie',
5
- 'David',
6
- 'Eve',
7
- 'Fred',
8
- 'Ginny',
9
- 'Harriet',
10
- 'Ileana',
11
- 'Joseph',
12
- 'Kincaid',
13
- 'Larry',
2
+ 'Alice',
3
+ 'Bob',
4
+ 'Charlie',
5
+ 'David',
6
+ 'Eve',
7
+ 'Fred',
8
+ 'Ginny',
9
+ 'Harriet',
10
+ 'Ileana',
11
+ 'Joseph',
12
+ 'Kincaid',
13
+ 'Larry',
14
14
  ]
15
15
 
16
16
  interface Plants {
17
- [code: string]: string
17
+ [code: string]: string
18
18
  }
19
19
 
20
20
  const plants: Plants = {
21
- G: "grass",
22
- V: "violets",
23
- R: "radishes",
24
- C: "clover"
21
+ G: "grass",
22
+ V: "violets",
23
+ R: "radishes",
24
+ C: "clover"
25
25
  }
26
26
 
27
27
  interface Pots {
28
- upper: string[]
29
- lower: string[]
28
+ upper: string[]
29
+ lower: string[]
30
30
  }
31
31
 
32
32
  const converToPots = (pots: string[][]): Pots => {
33
- return {
34
- upper: pots[0],
35
- lower: pots[1]
36
- }
33
+ return {
34
+ upper: pots[0],
35
+ lower: pots[1]
36
+ }
37
37
  }
38
38
 
39
39
  const getPlants = (pots: Pots, index: number): string[] => {
40
- const plants = []
41
- const position = 2 * index
42
- plants.push(pots.upper[position])
43
- plants.push(pots.upper[position + 1])
44
- plants.push(pots.lower[position])
45
- plants.push(pots.lower[position + 1])
46
- return plants
40
+ const plants = []
41
+ const position = 2 * index
42
+ plants.push(pots.upper[position])
43
+ plants.push(pots.upper[position + 1])
44
+ plants.push(pots.lower[position])
45
+ plants.push(pots.lower[position + 1])
46
+ return plants
47
47
  }
48
48
 
49
49
  const parse = (diagram: string): string[][] => {
50
- return diagram.split('\n').map((row) => [...row].map((sign) => plants[sign]))
50
+ return diagram.split('\n').map((row) => [...row].map((sign) => plants[sign]))
51
51
  }
52
52
 
53
53
  export default class Garden {
54
- [student: string]: string[]
54
+ [student: string]: string[]
55
55
 
56
- constructor(diagrams: string, students?: string[]) {
57
- this.students = students || defaultChildren
58
- this.students.sort()
56
+ constructor(diagrams: string, students?: string[]) {
57
+ this.students = students || defaultChildren
58
+ this.students.sort()
59
59
 
60
- this.students.forEach((student, index) => {
61
- this[student.toLocaleLowerCase()] = getPlants(converToPots(parse(diagrams)), index)
62
- })
63
- }
64
- }
60
+ this.students.forEach((student, index) => {
61
+ this[student.toLocaleLowerCase()] = getPlants(converToPots(parse(diagrams)), index)
62
+ })
63
+ }
64
+ }
@@ -1,131 +1,131 @@
1
1
  import Garden from './kindergarten-garden'
2
2
 
3
3
  describe('Garden', () => {
4
- it('for Alice', () => {
5
- expect(new Garden('RC\nGG').alice).toEqual(['radishes', 'clover', 'grass', 'grass'])
6
- })
7
-
8
- xit('another for Alice', () => {
9
- expect(new Garden('VC\nRC').alice)
10
- .toEqual(['violets', 'clover', 'radishes', 'clover'])
11
- })
12
-
13
- xit('for Bob', () => {
14
- expect(new Garden('VVCG\nVVRC').bob)
15
- .toEqual(['clover', 'grass', 'radishes', 'clover'])
16
- })
17
-
18
- xit('for Bob and Charlie', () => {
19
- const garden = new Garden('VVCCGG\nVVCCGG')
20
- expect(garden.bob).toEqual(['clover', 'clover', 'clover', 'clover'])
21
- expect(garden.charlie).toEqual(['grass', 'grass', 'grass', 'grass'])
22
- })
4
+ it('for Alice', () => {
5
+ expect(new Garden('RC\nGG').alice).toEqual(['radishes', 'clover', 'grass', 'grass'])
6
+ })
7
+
8
+ xit('another for Alice', () => {
9
+ expect(new Garden('VC\nRC').alice)
10
+ .toEqual(['violets', 'clover', 'radishes', 'clover'])
11
+ })
12
+
13
+ xit('for Bob', () => {
14
+ expect(new Garden('VVCG\nVVRC').bob)
15
+ .toEqual(['clover', 'grass', 'radishes', 'clover'])
16
+ })
17
+
18
+ xit('for Bob and Charlie', () => {
19
+ const garden = new Garden('VVCCGG\nVVCCGG')
20
+ expect(garden.bob).toEqual(['clover', 'clover', 'clover', 'clover'])
21
+ expect(garden.charlie).toEqual(['grass', 'grass', 'grass', 'grass'])
22
+ })
23
23
  })
24
24
 
25
25
  describe('Full garden', () => {
26
- const diagram = 'VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV'
27
- const garden = new Garden(diagram)
28
-
29
- xit('for Alice', () => {
30
- expect(garden.alice)
31
- .toEqual(['violets', 'radishes', 'violets', 'radishes'])
32
- })
33
-
34
- xit('for Bob', () => {
35
- expect(garden.bob)
36
- .toEqual(['clover', 'grass', 'clover', 'clover'])
37
- })
38
-
39
- xit('for Charlie', () => {
40
- expect(garden.charlie)
41
- .toEqual(['violets', 'violets', 'clover', 'grass'])
42
- })
43
-
44
- xit('for David', () => {
45
- expect(garden.david)
46
- .toEqual(['radishes', 'violets', 'clover', 'radishes'])
47
- })
48
-
49
- xit('for Eve', () => {
50
- expect(garden.eve)
51
- .toEqual(['clover', 'grass', 'radishes', 'grass'])
52
- })
53
-
54
- xit('for Fred', () => {
55
- expect(garden.fred)
56
- .toEqual(['grass', 'clover', 'violets', 'clover'])
57
- })
58
-
59
- xit('for Ginny', () => {
60
- expect(garden.ginny)
61
- .toEqual(['clover', 'grass', 'grass', 'clover'])
62
- })
63
-
64
- xit('for Harriet', () => {
65
- expect(garden.harriet)
66
- .toEqual(['violets', 'radishes', 'radishes', 'violets'])
67
- })
68
-
69
- xit('for Ileana', () => {
70
- expect(garden.ileana)
71
- .toEqual(['grass', 'clover', 'violets', 'clover'])
72
- })
73
-
74
- xit('for Joseph', () => {
75
- expect(garden.joseph)
76
- .toEqual(['violets', 'clover', 'violets', 'grass'])
77
- })
78
-
79
- xit('for Kincaid', () => {
80
- expect(garden.kincaid)
81
- .toEqual(['grass', 'clover', 'clover', 'grass'])
82
- })
83
-
84
- xit('for Larry', () => {
85
- expect(garden.larry)
86
- .toEqual(['grass', 'violets', 'clover', 'violets'])
87
- })
26
+ const diagram = 'VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV'
27
+ const garden = new Garden(diagram)
28
+
29
+ xit('for Alice', () => {
30
+ expect(garden.alice)
31
+ .toEqual(['violets', 'radishes', 'violets', 'radishes'])
32
+ })
33
+
34
+ xit('for Bob', () => {
35
+ expect(garden.bob)
36
+ .toEqual(['clover', 'grass', 'clover', 'clover'])
37
+ })
38
+
39
+ xit('for Charlie', () => {
40
+ expect(garden.charlie)
41
+ .toEqual(['violets', 'violets', 'clover', 'grass'])
42
+ })
43
+
44
+ xit('for David', () => {
45
+ expect(garden.david)
46
+ .toEqual(['radishes', 'violets', 'clover', 'radishes'])
47
+ })
48
+
49
+ xit('for Eve', () => {
50
+ expect(garden.eve)
51
+ .toEqual(['clover', 'grass', 'radishes', 'grass'])
52
+ })
53
+
54
+ xit('for Fred', () => {
55
+ expect(garden.fred)
56
+ .toEqual(['grass', 'clover', 'violets', 'clover'])
57
+ })
58
+
59
+ xit('for Ginny', () => {
60
+ expect(garden.ginny)
61
+ .toEqual(['clover', 'grass', 'grass', 'clover'])
62
+ })
63
+
64
+ xit('for Harriet', () => {
65
+ expect(garden.harriet)
66
+ .toEqual(['violets', 'radishes', 'radishes', 'violets'])
67
+ })
68
+
69
+ xit('for Ileana', () => {
70
+ expect(garden.ileana)
71
+ .toEqual(['grass', 'clover', 'violets', 'clover'])
72
+ })
73
+
74
+ xit('for Joseph', () => {
75
+ expect(garden.joseph)
76
+ .toEqual(['violets', 'clover', 'violets', 'grass'])
77
+ })
78
+
79
+ xit('for Kincaid', () => {
80
+ expect(garden.kincaid)
81
+ .toEqual(['grass', 'clover', 'clover', 'grass'])
82
+ })
83
+
84
+ xit('for Larry', () => {
85
+ expect(garden.larry)
86
+ .toEqual(['grass', 'violets', 'clover', 'violets'])
87
+ })
88
88
  })
89
89
 
90
90
  describe('Disordered class', () => {
91
- const diagram = 'VCRRGVRG\nRVGCCGCV'
92
- const students = ['Samantha', 'Patricia', 'Xander', 'Roger']
93
- const garden = new Garden(diagram, students)
94
-
95
- xit('Patricia', () => {
96
- expect(garden.patricia)
97
- .toEqual(['violets', 'clover', 'radishes', 'violets'])
98
- })
99
-
100
- xit('Roger', () => {
101
- expect(garden.roger)
102
- .toEqual(['radishes', 'radishes', 'grass', 'clover'])
103
- })
104
-
105
- xit('Samantha', () => {
106
- expect(garden.samantha)
107
- .toEqual(['grass', 'violets', 'clover', 'grass'])
108
- })
109
-
110
- xit('Xander', () => {
111
- expect(garden.xander)
112
- .toEqual(['radishes', 'grass', 'clover', 'violets'])
113
- })
91
+ const diagram = 'VCRRGVRG\nRVGCCGCV'
92
+ const students = ['Samantha', 'Patricia', 'Xander', 'Roger']
93
+ const garden = new Garden(diagram, students)
94
+
95
+ xit('Patricia', () => {
96
+ expect(garden.patricia)
97
+ .toEqual(['violets', 'clover', 'radishes', 'violets'])
98
+ })
99
+
100
+ xit('Roger', () => {
101
+ expect(garden.roger)
102
+ .toEqual(['radishes', 'radishes', 'grass', 'clover'])
103
+ })
104
+
105
+ xit('Samantha', () => {
106
+ expect(garden.samantha)
107
+ .toEqual(['grass', 'violets', 'clover', 'grass'])
108
+ })
109
+
110
+ xit('Xander', () => {
111
+ expect(garden.xander)
112
+ .toEqual(['radishes', 'grass', 'clover', 'violets'])
113
+ })
114
114
  })
115
115
 
116
116
  describe('Two gardens, different students', () => {
117
- const diagram = 'VCRRGVRG\nRVGCCGCV'
118
- const garden1 = new Garden(diagram, ['Alice', 'Bob', 'Charlie', 'Dan'])
119
- const garden2 = new Garden(diagram, ['Bob', 'Charlie', 'Dan', 'Erin'])
120
-
121
- xit('Bob and Charlie for each garden', () => {
122
- expect(garden1.bob)
123
- .toEqual(['radishes', 'radishes', 'grass', 'clover'])
124
- expect(garden2.bob)
125
- .toEqual(['violets', 'clover', 'radishes', 'violets'])
126
- expect(garden1.charlie)
127
- .toEqual(['grass', 'violets', 'clover', 'grass'])
128
- expect(garden2.charlie)
129
- .toEqual(['radishes', 'radishes', 'grass', 'clover'])
130
- })
117
+ const diagram = 'VCRRGVRG\nRVGCCGCV'
118
+ const garden1 = new Garden(diagram, ['Alice', 'Bob', 'Charlie', 'Dan'])
119
+ const garden2 = new Garden(diagram, ['Bob', 'Charlie', 'Dan', 'Erin'])
120
+
121
+ xit('Bob and Charlie for each garden', () => {
122
+ expect(garden1.bob)
123
+ .toEqual(['radishes', 'radishes', 'grass', 'clover'])
124
+ expect(garden2.bob)
125
+ .toEqual(['violets', 'clover', 'radishes', 'violets'])
126
+ expect(garden1.charlie)
127
+ .toEqual(['grass', 'violets', 'clover', 'grass'])
128
+ expect(garden2.charlie)
129
+ .toEqual(['radishes', 'radishes', 'grass', 'clover'])
130
+ })
131
131
  })
@@ -1,7 +0,0 @@
1
- export default class Garden {
2
- [student: string]: string[];
3
-
4
- constructor(diagrams: string, students?: string[]) {
5
-
6
- }
7
- }
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.2.1.125
4
+ version: 2.2.1.126
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katrina Owen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-29 00:00:00.000000000 Z
11
+ date: 2018-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -4922,6 +4922,12 @@ files:
4922
4922
  - tracks/erlang/exercises/hello-world/src/hello_world.app.src
4923
4923
  - tracks/erlang/exercises/hello-world/src/hello_world.erl
4924
4924
  - tracks/erlang/exercises/hello-world/test/hello_world_tests.erl
4925
+ - tracks/erlang/exercises/isbn-verifier/README.md
4926
+ - tracks/erlang/exercises/isbn-verifier/rebar.config
4927
+ - tracks/erlang/exercises/isbn-verifier/src/example.erl
4928
+ - tracks/erlang/exercises/isbn-verifier/src/isbn_verifier.app.src
4929
+ - tracks/erlang/exercises/isbn-verifier/src/isbn_verifier.erl
4930
+ - tracks/erlang/exercises/isbn-verifier/test/isbn_verifier_tests.erl
4925
4931
  - tracks/erlang/exercises/isogram/README.md
4926
4932
  - tracks/erlang/exercises/isogram/rebar.config
4927
4933
  - tracks/erlang/exercises/isogram/src/example.erl
@@ -14718,6 +14724,14 @@ files:
14718
14724
  - tracks/typescript/exercises/acronym/tsconfig.json
14719
14725
  - tracks/typescript/exercises/acronym/tslint.json
14720
14726
  - tracks/typescript/exercises/acronym/yarn.lock
14727
+ - tracks/typescript/exercises/all-your-base/README.md
14728
+ - tracks/typescript/exercises/all-your-base/all-your-base.example.ts
14729
+ - tracks/typescript/exercises/all-your-base/all-your-base.test.ts
14730
+ - tracks/typescript/exercises/all-your-base/all-your-base.ts
14731
+ - tracks/typescript/exercises/all-your-base/package.json
14732
+ - tracks/typescript/exercises/all-your-base/tsconfig.json
14733
+ - tracks/typescript/exercises/all-your-base/tslint.json
14734
+ - tracks/typescript/exercises/all-your-base/yarn.lock
14721
14735
  - tracks/typescript/exercises/allergies/README.md
14722
14736
  - tracks/typescript/exercises/allergies/allergies.example.ts
14723
14737
  - tracks/typescript/exercises/allergies/allergies.test.ts
@@ -14815,6 +14829,14 @@ files:
14815
14829
  - tracks/typescript/exercises/collatz-conjecture/tsconfig.json
14816
14830
  - tracks/typescript/exercises/collatz-conjecture/tslint.json
14817
14831
  - tracks/typescript/exercises/collatz-conjecture/yarn.lock
14832
+ - tracks/typescript/exercises/crypto-square/README.md
14833
+ - tracks/typescript/exercises/crypto-square/crypto-square.example.ts
14834
+ - tracks/typescript/exercises/crypto-square/crypto-square.test.ts
14835
+ - tracks/typescript/exercises/crypto-square/crypto-square.ts
14836
+ - tracks/typescript/exercises/crypto-square/package.json
14837
+ - tracks/typescript/exercises/crypto-square/tsconfig.json
14838
+ - tracks/typescript/exercises/crypto-square/tslint.json
14839
+ - tracks/typescript/exercises/crypto-square/yarn.lock
14818
14840
  - tracks/typescript/exercises/diamond/README.md
14819
14841
  - tracks/typescript/exercises/diamond/diamond.example.ts
14820
14842
  - tracks/typescript/exercises/diamond/diamond.test.ts