trackler 2.0.8.15 → 2.0.8.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/common/exercises/clock/canonical-data.json +473 -425
  3. data/common/exercises/crypto-square/canonical-data.json +105 -95
  4. data/common/exercises/difference-of-squares/canonical-data.json +76 -62
  5. data/common/exercises/etl/canonical-data.json +67 -59
  6. data/common/exercises/meetup/canonical-data.json +859 -762
  7. data/common/exercises/meetup/description.md +13 -7
  8. data/common/exercises/minesweeper/canonical-data.json +21 -5
  9. data/common/exercises/nth-prime/canonical-data.json +23 -16
  10. data/common/exercises/nucleotide-count/canonical-data.json +49 -41
  11. data/common/exercises/ocr-numbers/canonical-data.json +204 -183
  12. data/common/exercises/pascals-triangle/canonical-data.json +38 -27
  13. data/common/exercises/queen-attack/canonical-data.json +125 -109
  14. data/common/exercises/rotational-cipher/canonical-data.json +1 -1
  15. data/common/exercises/triangle/canonical-data.json +103 -74
  16. data/lib/trackler/version.rb +1 -1
  17. data/tracks/csharp/docs/TESTS.md +7 -1
  18. data/tracks/csharp/exercises/{exercises.sln → Exercises.All.sln} +0 -0
  19. data/tracks/csharp/exercises/Exercises.Default.sln +1433 -0
  20. data/tracks/csharp/exercises/Exercises.Refactoring.sln +61 -0
  21. data/tracks/csharp/exercises/acronym/AcronymTest.cs +35 -11
  22. data/tracks/csharp/exercises/parallel-letter-frequency/ParallelLetterFrequencyTest.cs +2 -2
  23. data/tracks/delphi/docs/TESTS.md +2 -2
  24. data/tracks/elixir/exercises/bowling/bowling.exs +1 -1
  25. data/tracks/fsharp/docs/LEARNING.md +2 -1
  26. data/tracks/go/config.json +7 -1
  27. data/tracks/go/exercises/prime-factors/{primefactors_test.go → prime_factors_test.go} +4 -1
  28. data/tracks/go/exercises/protein-translation/protein_translation_test.go +6 -6
  29. data/tracks/go/exercises/pythagorean-triplet/example.go +2 -0
  30. data/tracks/go/exercises/pythagorean-triplet/pythagorean_triplet_test.go +8 -0
  31. data/tracks/julia/README.md +2 -0
  32. data/tracks/julia/config.json +9 -0
  33. data/tracks/julia/exercises/rotational-cipher/HINTS.md +21 -0
  34. data/tracks/julia/exercises/rotational-cipher/example.jl +16 -0
  35. data/tracks/julia/exercises/rotational-cipher/rotational-cipher.jl +0 -0
  36. data/tracks/julia/exercises/rotational-cipher/runtests.jl +51 -0
  37. data/tracks/ocaml/config.json +5 -0
  38. data/tracks/ocaml/exercises/connect/.merlin +3 -0
  39. data/tracks/ocaml/exercises/connect/Makefile +15 -0
  40. data/tracks/ocaml/exercises/connect/connect.mli +4 -0
  41. data/tracks/ocaml/exercises/connect/example.ml +80 -0
  42. data/tracks/ocaml/exercises/connect/test.ml +121 -0
  43. data/tracks/ocaml/tools/test-generator/templates/connect/template.ml +23 -0
  44. data/tracks/python/exercises/all-your-base/all_your_base_test.py +2 -0
  45. data/tracks/python/exercises/luhn/example.py +5 -8
  46. data/tracks/python/exercises/luhn/luhn_test.py +34 -24
  47. data/tracks/ruby/README.md +138 -23
  48. metadata +16 -4
@@ -1,14 +1,20 @@
1
- Typically meetups happen on the same day of the week.
1
+ Typically meetups happen on the same day of the week. In this exercise, you will take
2
+ a description of a meetup date, and return the actual meetup date.
2
3
 
3
- Examples are
4
+ Examples of general descriptions are:
4
5
 
5
- - the first Monday
6
- - the third Tuesday
7
- - the Wednesteenth
8
- - the last Thursday
6
+ - the first Monday of January 2017
7
+ - the third Tuesday of January 2017
8
+ - the Wednesteenth of January 2017
9
+ - the last Thursday of January 2017
9
10
 
10
11
  Note that "Monteenth", "Tuesteenth", etc are all made up words. There
11
- was a meetup whose members realised that there are exactly 7 days that
12
+ was a meetup whose members realized that there are exactly 7 numbered days in a month that
12
13
  end in '-teenth'. Therefore, one is guaranteed that each day of the week
13
14
  (Monday, Tuesday, ...) will have exactly one date that is named with '-teenth'
14
15
  in every month.
16
+
17
+ Given examples of a meetup dates, each containing a month, day, year, and descriptor
18
+ (first, second, teenth, etc), calculate the date of the actual meetup.
19
+ For example, if given "First Monday of January 2017", the correct meetup date is 2017/1/2
20
+
@@ -1,21 +1,28 @@
1
1
  {
2
- "#": [
3
- "The expected outputs are represented as arrays of strings to improve readability in this JSON file.",
4
- "Your track may choose whether to present the input as a single string (concatenating all the lines) or as the list."
2
+ "exercise": "minesweeper",
3
+ "version": "1.0.0",
4
+ "comments": [
5
+ " The expected outputs are represented as arrays of strings to ",
6
+ " improve readability in this JSON file. ",
7
+ " Your track may choose whether to present the input as a single ",
8
+ " string (concatenating all the lines) or as the list. "
5
9
  ],
6
10
  "cases": [
7
11
  {
8
12
  "description": "no rows",
9
- "input" : [],
13
+ "property": "annotate",
14
+ "input": [],
10
15
  "expected": []
11
16
  },
12
17
  {
13
18
  "description": "no columns",
14
- "input" : [""],
19
+ "property": "annotate",
20
+ "input": [""],
15
21
  "expected": [""]
16
22
  },
17
23
  {
18
24
  "description": "no mines",
25
+ "property": "annotate",
19
26
  "input": [
20
27
  " ",
21
28
  " ",
@@ -29,6 +36,7 @@
29
36
  },
30
37
  {
31
38
  "description": "board with only mines",
39
+ "property": "annotate",
32
40
  "input": [
33
41
  "***",
34
42
  "***",
@@ -42,6 +50,7 @@
42
50
  },
43
51
  {
44
52
  "description": "mine surrounded by spaces",
53
+ "property": "annotate",
45
54
  "input": [
46
55
  " ",
47
56
  " * ",
@@ -55,6 +64,7 @@
55
64
  },
56
65
  {
57
66
  "description": "space surrounded by mines",
67
+ "property": "annotate",
58
68
  "input": [
59
69
  "***",
60
70
  "* *",
@@ -68,16 +78,19 @@
68
78
  },
69
79
  {
70
80
  "description": "horizontal line",
81
+ "property": "annotate",
71
82
  "input": [" * * "],
72
83
  "expected": ["1*2*1"]
73
84
  },
74
85
  {
75
86
  "description": "horizontal line, mines at edges",
87
+ "property": "annotate",
76
88
  "input": ["* *"],
77
89
  "expected": ["*1 1*"]
78
90
  },
79
91
  {
80
92
  "description": "vertical line",
93
+ "property": "annotate",
81
94
  "input": [
82
95
  " ",
83
96
  "*",
@@ -95,6 +108,7 @@
95
108
  },
96
109
  {
97
110
  "description": "vertical line, mines at edges",
111
+ "property": "annotate",
98
112
  "input": [
99
113
  "*",
100
114
  " ",
@@ -112,6 +126,7 @@
112
126
  },
113
127
  {
114
128
  "description": "cross",
129
+ "property": "annotate",
115
130
  "input": [
116
131
  " * ",
117
132
  " * ",
@@ -129,6 +144,7 @@
129
144
  },
130
145
  {
131
146
  "description": "large board",
147
+ "property": "annotate",
132
148
  "input": [
133
149
  " * * ",
134
150
  " * ",
@@ -1,34 +1,41 @@
1
1
  {
2
- "#": [
2
+ "exercise": "nth-prime",
3
+ "version": "1.0.0",
4
+ "comments": [
3
5
  "The tests that expect 'false' should be implemented to raise",
4
6
  "an error, or indicate a failure. Implement this in a way that",
5
7
  "makes sense for your language."
6
8
  ],
7
9
  "cases": [
8
10
  {
9
- "description": "first prime",
10
- "input": 1,
11
- "expected": 2
11
+ "description": "first prime",
12
+ "property": "prime",
13
+ "input": 1,
14
+ "expected": 2
12
15
  },
13
16
  {
14
- "description": "second prime",
15
- "input": 2,
16
- "expected": 3
17
+ "description": "second prime",
18
+ "property": "prime",
19
+ "input": 2,
20
+ "expected": 3
17
21
  },
18
22
  {
19
- "description": "sixth prime",
20
- "input": 6,
21
- "expected": 13
23
+ "description": "sixth prime",
24
+ "property": "prime",
25
+ "input": 6,
26
+ "expected": 13
22
27
  },
23
28
  {
24
- "description": "big prime",
25
- "input": 10001,
26
- "expected": 104743
29
+ "description": "big prime",
30
+ "property": "prime",
31
+ "input": 10001,
32
+ "expected": 104743
27
33
  },
28
34
  {
29
- "description": "there is no zeroth prime",
30
- "input": 0,
31
- "expected": false
35
+ "description": "there is no zeroth prime",
36
+ "property": "prime",
37
+ "input": 0,
38
+ "expected": false
32
39
  }
33
40
  ]
34
41
  }
@@ -1,44 +1,52 @@
1
1
  {
2
- "nucleotide_counts": {
3
- "description": "count all nucleotides in a strand",
4
- "cases": [
5
- {
6
- "description": "empty strand",
7
- "strand": "",
8
- "expected": {
9
- "A": 0,
10
- "C": 0,
11
- "G": 0,
12
- "T": 0
2
+ "exercise": "nucleotide-count",
3
+ "version": "1.0.0",
4
+ "cases": [
5
+ {
6
+ "description": "count all nucleotides in a strand",
7
+ "cases": [
8
+ {
9
+ "description": "empty strand",
10
+ "property": "nucleotideCounts",
11
+ "strand": "",
12
+ "expected": {
13
+ "A": 0,
14
+ "C": 0,
15
+ "G": 0,
16
+ "T": 0
17
+ }
18
+ },
19
+ {
20
+ "description": "strand with repeated nucleotide",
21
+ "property": "nucleotideCounts",
22
+ "strand": "GGGGGGG",
23
+ "expected": {
24
+ "A": 0,
25
+ "C": 0,
26
+ "G": 7,
27
+ "T": 0
28
+ }
29
+ },
30
+ {
31
+ "description": "strand with multiple nucleotides",
32
+ "property": "nucleotideCounts",
33
+ "strand": "AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC",
34
+ "expected": {
35
+ "A": 20,
36
+ "C": 12,
37
+ "G": 17,
38
+ "T": 21
39
+ }
40
+ },
41
+ {
42
+ "description": "strand with invalid nucleotides",
43
+ "property": "nucleotideCounts",
44
+ "strand": "AGXXACT",
45
+ "expected": {
46
+ "error": "Invalid nucleotide in strand"
47
+ }
13
48
  }
14
- },
15
- {
16
- "description": "strand with repeated nucleotide",
17
- "strand": "GGGGGGG",
18
- "expected": {
19
- "A": 0,
20
- "C": 0,
21
- "G": 7,
22
- "T": 0
23
- }
24
- },
25
- {
26
- "description": "strand with multiple nucleotides",
27
- "strand": "AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC",
28
- "expected": {
29
- "A": 20,
30
- "C": 12,
31
- "G": 17,
32
- "T": 21
33
- }
34
- },
35
- {
36
- "description": "strand with invalid nucleotides",
37
- "strand": "AGXXACT",
38
- "expected": {
39
- "error": "Invalid nucleotide in strand"
40
- }
41
- }
42
- ]
43
- }
49
+ ]
50
+ }
51
+ ]
44
52
  }
@@ -1,187 +1,208 @@
1
1
  {
2
- "#": [
2
+ "exercise": "ocr-numbers",
3
+ "version": "1.0.0",
4
+ "comments": [
3
5
  "An expectation of -1 indicates that a failure should be raised"
4
6
  ],
5
- "convert": {
6
- "description": "Converts lines of OCR Numbers to a string of integers",
7
- "cases": [
8
- {
9
- "description": "Recognizes 0",
10
- "input": [
11
- " _ ",
12
- "| |",
13
- "|_|",
14
- " "
15
- ],
16
- "expected": "0"
17
- },
18
- {
19
- "description": "Recognizes 1",
20
- "input": [
21
- " ",
22
- " |",
23
- " |",
24
- " "
25
- ],
26
- "expected": "1"
27
- },
28
- {
29
- "description": "Unreadable but correctly sized inputs return ?",
30
- "input": [
31
- " ",
32
- " _",
33
- " |",
34
- " "
35
- ],
36
- "expected": "?"
37
- },
38
- {
39
- "description": "Input with a number of lines that is not a multiple of four raises an error",
40
- "input": [
41
- " _ ",
42
- "| |",
43
- " "
44
- ],
45
- "expected": -1
46
- },
47
- {
48
- "description": "Input with a number of columns that is not a multiple of three raises an error",
49
- "input": [
50
- " ",
51
- " |",
52
- " |",
53
- " "
54
- ],
55
- "expected": -1
56
- },
57
- {
58
- "description": "Recognizes 110101100",
59
- "input": [
60
- " _ _ _ _ ",
61
- " | || | || | | || || |",
62
- " | ||_| ||_| | ||_||_|",
63
- " "
64
- ],
65
- "expected": "110101100"
66
- },
67
- {
68
- "description": "Garbled numbers in a string are replaced with ?",
69
- "input": [
70
- " _ _ _ ",
71
- " | || | || | || || |",
72
- " | | _| ||_| | ||_||_|",
73
- " "
74
- ],
75
- "expected": "11?10?1?0"
76
- },
77
- {
78
- "description": "Recognizes 2",
79
- "input": [
80
- " _ ",
81
- " _|",
82
- "|_ ",
83
- " "
84
- ],
85
- "expected": "2"
86
- },
87
- {
88
- "description": "Recognizes 3",
89
- "input": [
90
- " _ ",
91
- " _|",
92
- " _|",
93
- " "
94
- ],
95
- "expected": "3"
96
- },
97
- {
98
- "description": "Recognizes 4",
99
- "input": [
100
- " ",
101
- "|_|",
102
- " |",
103
- " "
104
- ],
105
- "expected": "4"
106
- },
107
- {
108
- "description": "Recognizes 5",
109
- "input": [
110
- " _ ",
111
- "|_ ",
112
- " _|",
113
- " "
114
- ],
115
- "expected": "5"
116
- },
117
- {
118
- "description": "Recognizes 6",
119
- "input": [
120
- " _ ",
121
- "|_ ",
122
- "|_|",
123
- " "
124
- ],
125
- "expected": "6"
126
- },
127
- {
128
- "description": "Recognizes 7",
129
- "input": [
130
- " _ ",
131
- " |",
132
- " |",
133
- " "
134
- ],
135
- "expected": "7"
136
- },
137
- {
138
- "description": "Recognizes 8",
139
- "input": [
140
- " _ ",
141
- "|_|",
142
- "|_|",
143
- " "
144
- ],
145
- "expected": "8"
146
- },
147
- {
148
- "description": "Recognizes 9",
149
- "input": [
150
- " _ ",
151
- "|_|",
152
- " _|",
153
- " "
154
- ],
155
- "expected": "9"
156
- },
157
- {
158
- "description": "Recognizes string of decimal numbers",
159
- "input": [
160
- " _ _ _ _ _ _ _ _ ",
161
- " | _| _||_||_ |_ ||_||_|| |",
162
- " ||_ _| | _||_| ||_| _||_|",
163
- " "
164
- ],
165
- "expected": "1234567890"
166
- },
167
- {
168
- "description": "Numbers separated by empty lines are recognized. Lines are joined by commas.",
169
- "input": [
170
- " _ _ ",
171
- " | _| _|",
172
- " ||_ _|",
173
- " ",
174
- " _ _ ",
175
- "|_||_ |_ ",
176
- " | _||_|",
177
- " ",
178
- " _ _ _ ",
179
- " ||_||_|",
180
- " ||_| _|",
181
- " "
182
- ],
183
- "expected": "123,456,789"
184
- }
185
- ]
186
- }
7
+ "cases": [
8
+ {
9
+ "description": "Converts lines of OCR Numbers to a string of integers",
10
+ "cases": [
11
+ {
12
+ "description": "Recognizes 0",
13
+ "property": "convert",
14
+ "input": [
15
+ " _ ",
16
+ "| |",
17
+ "|_|",
18
+ " "
19
+ ],
20
+ "expected": "0"
21
+ },
22
+ {
23
+ "description": "Recognizes 1",
24
+ "property": "convert",
25
+ "input": [
26
+ " ",
27
+ " |",
28
+ " |",
29
+ " "
30
+ ],
31
+ "expected": "1"
32
+ },
33
+ {
34
+ "description": "Unreadable but correctly sized inputs return ?",
35
+ "property": "convert",
36
+ "input": [
37
+ " ",
38
+ " _",
39
+ " |",
40
+ " "
41
+ ],
42
+ "expected": "?"
43
+ },
44
+ {
45
+ "description": "Input with a number of lines that is not a multiple of four raises an error",
46
+ "property": "convert",
47
+ "input": [
48
+ " _ ",
49
+ "| |",
50
+ " "
51
+ ],
52
+ "expected": -1
53
+ },
54
+ {
55
+ "description": "Input with a number of columns that is not a multiple of three raises an error",
56
+ "property": "convert",
57
+ "input": [
58
+ " ",
59
+ " |",
60
+ " |",
61
+ " "
62
+ ],
63
+ "expected": -1
64
+ },
65
+ {
66
+ "description": "Recognizes 110101100",
67
+ "property": "convert",
68
+ "input": [
69
+ " _ _ _ _ ",
70
+ " | || | || | | || || |",
71
+ " | ||_| ||_| | ||_||_|",
72
+ " "
73
+ ],
74
+ "expected": "110101100"
75
+ },
76
+ {
77
+ "description": "Garbled numbers in a string are replaced with ?",
78
+ "property": "convert",
79
+ "input": [
80
+ " _ _ _ ",
81
+ " | || | || | || || |",
82
+ " | | _| ||_| | ||_||_|",
83
+ " "
84
+ ],
85
+ "expected": "11?10?1?0"
86
+ },
87
+ {
88
+ "description": "Recognizes 2",
89
+ "property": "convert",
90
+ "input": [
91
+ " _ ",
92
+ " _|",
93
+ "|_ ",
94
+ " "
95
+ ],
96
+ "expected": "2"
97
+ },
98
+ {
99
+ "description": "Recognizes 3",
100
+ "property": "convert",
101
+ "input": [
102
+ " _ ",
103
+ " _|",
104
+ " _|",
105
+ " "
106
+ ],
107
+ "expected": "3"
108
+ },
109
+ {
110
+ "description": "Recognizes 4",
111
+ "property": "convert",
112
+ "input": [
113
+ " ",
114
+ "|_|",
115
+ " |",
116
+ " "
117
+ ],
118
+ "expected": "4"
119
+ },
120
+ {
121
+ "description": "Recognizes 5",
122
+ "property": "convert",
123
+ "input": [
124
+ " _ ",
125
+ "|_ ",
126
+ " _|",
127
+ " "
128
+ ],
129
+ "expected": "5"
130
+ },
131
+ {
132
+ "description": "Recognizes 6",
133
+ "property": "convert",
134
+ "input": [
135
+ " _ ",
136
+ "|_ ",
137
+ "|_|",
138
+ " "
139
+ ],
140
+ "expected": "6"
141
+ },
142
+ {
143
+ "description": "Recognizes 7",
144
+ "property": "convert",
145
+ "input": [
146
+ " _ ",
147
+ " |",
148
+ " |",
149
+ " "
150
+ ],
151
+ "expected": "7"
152
+ },
153
+ {
154
+ "description": "Recognizes 8",
155
+ "property": "convert",
156
+ "input": [
157
+ " _ ",
158
+ "|_|",
159
+ "|_|",
160
+ " "
161
+ ],
162
+ "expected": "8"
163
+ },
164
+ {
165
+ "description": "Recognizes 9",
166
+ "property": "convert",
167
+ "input": [
168
+ " _ ",
169
+ "|_|",
170
+ " _|",
171
+ " "
172
+ ],
173
+ "expected": "9"
174
+ },
175
+ {
176
+ "description": "Recognizes string of decimal numbers",
177
+ "property": "convert",
178
+ "input": [
179
+ " _ _ _ _ _ _ _ _ ",
180
+ " | _| _||_||_ |_ ||_||_|| |",
181
+ " ||_ _| | _||_| ||_| _||_|",
182
+ " "
183
+ ],
184
+ "expected": "1234567890"
185
+ },
186
+ {
187
+ "description": "Numbers separated by empty lines are recognized. Lines are joined by commas.",
188
+ "property": "convert",
189
+ "input": [
190
+ " _ _ ",
191
+ " | _| _|",
192
+ " ||_ _|",
193
+ " ",
194
+ " _ _ ",
195
+ "|_||_ |_ ",
196
+ " | _||_|",
197
+ " ",
198
+ " _ _ _ ",
199
+ " ||_||_|",
200
+ " ||_| _|",
201
+ " "
202
+ ],
203
+ "expected": "123,456,789"
204
+ }
205
+ ]
206
+ }
207
+ ]
187
208
  }