trackler 2.2.1.30 → 2.2.1.31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/exercises/word-search/canonical-data.json +278 -4
  4. data/tracks/c/exercises/raindrops/test/test_raindrops.c +0 -16
  5. data/tracks/ceylon/README.md +1 -1
  6. data/tracks/ceylon/config.json +12 -0
  7. data/tracks/ceylon/docs/RESOURCES.md +1 -1
  8. data/tracks/ceylon/exercises/anagram/source/anagram/AnagramTest.ceylon +1 -1
  9. data/tracks/ceylon/exercises/anagram/source/anagram/module.ceylon +1 -1
  10. data/tracks/ceylon/exercises/bracket-push/example/module.ceylon +2 -2
  11. data/tracks/ceylon/exercises/bracket-push/source/bracketpush/BracketsTest.ceylon +1 -1
  12. data/tracks/ceylon/exercises/bracket-push/source/bracketpush/module.ceylon +1 -1
  13. data/tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon +1 -1
  14. data/tracks/ceylon/exercises/hamming/source/hamming/module.ceylon +1 -1
  15. data/tracks/ceylon/exercises/largest-series-product/source/largestseriesproduct/SeriesTest.ceylon +1 -1
  16. data/tracks/ceylon/exercises/largest-series-product/source/largestseriesproduct/module.ceylon +1 -1
  17. data/tracks/ceylon/exercises/leap/source/leap/LeapTest.ceylon +1 -1
  18. data/tracks/ceylon/exercises/leap/source/leap/module.ceylon +1 -1
  19. data/tracks/ceylon/exercises/react/example/module.ceylon +2 -2
  20. data/tracks/ceylon/exercises/react/source/react/ReactorTest.ceylon +1 -1
  21. data/tracks/ceylon/exercises/react/source/react/module.ceylon +1 -1
  22. data/tracks/ceylon/exercises/rna-transcription/README.md +41 -0
  23. data/tracks/ceylon/exercises/rna-transcription/example/RNA.ceylon +13 -0
  24. data/tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNA.ceylon +5 -0
  25. data/tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNAtest.ceylon +33 -0
  26. data/tracks/ceylon/exercises/rna-transcription/source/rnatranscription/module.ceylon +3 -0
  27. data/tracks/ceylon/exercises/sieve/example/module.ceylon +2 -2
  28. data/tracks/ceylon/exercises/sieve/source/sieve/SieveTest.ceylon +1 -1
  29. data/tracks/ceylon/exercises/sieve/source/sieve/module.ceylon +1 -1
  30. data/tracks/clojure/.travis.yml +1 -1
  31. data/tracks/clojure/_src/generator.clj +1 -1
  32. data/tracks/clojure/exercises/clock/{clock.mustache → .meta/clock.mustache} +0 -0
  33. data/tracks/clojure/exercises/luhn/{luhn.mustache → .meta/luhn.mustache} +0 -0
  34. data/tracks/clojure/exercises/sublist/{sublist.mustache → .meta/sublist.mustache} +0 -0
  35. data/tracks/go/exercises/robot-name/.meta/hints.md +13 -0
  36. data/tracks/go/exercises/robot-name/bonus_example.go +2 -0
  37. data/tracks/java/gradle/wrapper/gradle-wrapper.jar +0 -0
  38. data/tracks/java/gradle/wrapper/gradle-wrapper.properties +2 -2
  39. data/tracks/java/gradlew +3 -3
  40. data/tracks/java/gradlew.bat +0 -0
  41. data/tracks/php/config.json +8 -0
  42. data/tracks/php/exercises/flatten-array/example.php +10 -0
  43. data/tracks/php/exercises/flatten-array/flatten-array_test.php +51 -0
  44. data/tracks/ruby/exercises/hello-world/GETTING_STARTED.md +2 -2
  45. data/tracks/scala/exercises/accumulate/src/test/scala/AccumulateTest.scala +1 -0
  46. data/tracks/scala/exercises/allergies/example.scala +3 -3
  47. data/tracks/scala/exercises/allergies/src/test/scala/AllergiesTest.scala +68 -33
  48. data/tracks/scala/exercises/bank-account/src/test/scala/BankAccountTest.scala +1 -0
  49. data/tracks/scala/exercises/binary-search-tree/src/test/scala/BstTest.scala +1 -0
  50. data/tracks/scala/exercises/connect/example.scala +1 -1
  51. data/tracks/scala/exercises/connect/src/test/scala/ConnectTest.scala +72 -56
  52. data/tracks/scala/exercises/dominoes/src/main/scala/.keep +0 -0
  53. data/tracks/scala/exercises/dominoes/src/test/scala/DominoesTest.scala +32 -31
  54. data/tracks/scala/exercises/grade-school/src/test/scala/GradeSchoolTest.scala +1 -0
  55. data/tracks/scala/exercises/lens-person/src/test/scala/LensPersonTest.scala +1 -0
  56. data/tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala +1 -0
  57. data/tracks/scala/exercises/matrix/src/test/scala/MatrixTest.scala +1 -0
  58. data/tracks/scala/exercises/parallel-letter-frequency/src/test/scala/FrequencyTest.scala +1 -0
  59. data/tracks/scala/exercises/protein-translation/src/test/scala/ProteinTranslationTest.scala +2 -1
  60. data/tracks/scala/exercises/pythagorean-triplet/src/test/scala/PythagoreanTripletTest.scala +1 -0
  61. data/tracks/scala/exercises/robot-name/src/test/scala/RobotNameTest.scala +1 -0
  62. data/tracks/scala/exercises/series/src/test/scala/SeriesTest.scala +1 -0
  63. data/tracks/scala/exercises/sgf-parsing/src/test/scala/SgfTest.scala +1 -0
  64. data/tracks/scala/exercises/simple-cipher/src/test/scala/CipherTest.scala +1 -0
  65. data/tracks/scala/exercises/simple-linked-list/src/test/scala/SimpleLinkedListTest.scala +1 -1
  66. data/tracks/scala/exercises/strain/src/test/scala/StrainTest.scala +2 -1
  67. data/tracks/scala/exercises/wordy/example.scala +3 -3
  68. data/tracks/scala/exercises/wordy/src/test/scala/WordyTest.scala +84 -0
  69. data/tracks/scala/exercises/zebra-puzzle/src/test/scala/ZebraPuzzleTest.scala +1 -0
  70. data/tracks/scala/exercises/zipper/src/test/scala/ZipperTest.scala +1 -0
  71. data/tracks/scala/testgen/src/main/scala/AllergiesTestGenerator.scala +60 -0
  72. data/tracks/scala/testgen/src/main/scala/ConnectTestGenerator.scala +52 -0
  73. data/tracks/scala/testgen/src/main/scala/DominoesTestGenerator.scala +71 -0
  74. data/tracks/scala/testgen/src/main/scala/WordyTestGenerator.scala +35 -0
  75. data/tracks/scala/testgen/src/main/scala/testgen/TestSuiteBuilder.scala +20 -0
  76. data/tracks/scala/testgen/src/main/twirl/funSuiteTemplateIgnoreExpected.scala.txt +16 -0
  77. metadata +20 -8
  78. data/tracks/scala/exercises/allergies/src/main/scala/Allergies.scala +0 -11
  79. data/tracks/scala/exercises/dominoes/src/main/scala/Dominoes.scala +0 -4
  80. data/tracks/scala/exercises/wordy/src/test/scala/WordProblemTest.scala +0 -81
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bdf0e0d6c594cd77a6f4b79fc7480e4ee5f676d0
4
- data.tar.gz: 131bf739d9c41e23908f22b20acaa5198e97da1d
3
+ metadata.gz: de05c3cb196794d1fcb7efdf1927f8ea001284c6
4
+ data.tar.gz: 43bc093840d44d5e958228bd019eac27d9ea7856
5
5
  SHA512:
6
- metadata.gz: d1d9ece273b652b82a62e20c2069b8776b6b99462ce34908274f21560cb983baf11090e27f9dfc0187965c4c28f751282d3b41f9493330f197ceffe2b94322a0
7
- data.tar.gz: dce5e31c706fcf81aae54e0a0d908fd91ece38026186eb416463c567744b7da88b2caad5b6c161283f0ed944d0639c3bc03206093ad128d38a6ca1350522d5c1
6
+ metadata.gz: 485b6ee9100a899bb2b5fcdf23b6f3369bb74d4b10f21c54093b22f225c0e5e4ea76d8bcb8ff38b2f19d88ce23f8f2a8317beade958f6b04d49c7e7659280489
7
+ data.tar.gz: 35ba23c29c2058c31b48f87fc2ae17483c7a376899819fd2604714f12de17ee07053cf2f1e3bb89c8c67045c49dec41e0417b436b09508de79aaa80dd799d9db
@@ -1,3 +1,3 @@
1
1
  module Trackler
2
- VERSION = "2.2.1.30"
2
+ VERSION = "2.2.1.31"
3
3
  end
@@ -1,13 +1,161 @@
1
1
  {
2
2
  "exercise": "word-search",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "comments": [
5
5
  "Grid rows and columns are 1-indexed.",
6
6
  "An expected value of -1 indicates that some sort of failure should occur."
7
7
  ],
8
8
  "cases": [
9
9
  {
10
- "description": "Should locate words written left to right",
10
+ "description": "Should accept an initial game grid and a target search word",
11
+ "property": "search",
12
+ "grid": [
13
+ "jefblpepre"
14
+ ],
15
+ "wordsToSearchFor": [
16
+ "clojure"
17
+ ],
18
+ "expected": {
19
+ "clojure": null
20
+ }
21
+ },
22
+ {
23
+ "description": "Should locate one word written left to right",
24
+ "property": "search",
25
+ "grid": [
26
+ "clojurermt"
27
+ ],
28
+ "wordsToSearchFor": [
29
+ "clojure"
30
+ ],
31
+ "expected": {
32
+ "clojure": {
33
+ "start": {
34
+ "column": 1,
35
+ "row": 1
36
+ },
37
+ "end": {
38
+ "column": 7,
39
+ "row": 1
40
+ }
41
+ }
42
+ }
43
+ },
44
+ {
45
+ "description": "Should locate the same word written left to right in a different position",
46
+ "property": "search",
47
+ "grid": [
48
+ "mtclojurer"
49
+ ],
50
+ "wordsToSearchFor": [
51
+ "clojure"
52
+ ],
53
+ "expected": {
54
+ "clojure": {
55
+ "start": {
56
+ "column": 3,
57
+ "row": 1
58
+ },
59
+ "end": {
60
+ "column": 9,
61
+ "row": 1
62
+ }
63
+ }
64
+ }
65
+ },
66
+ {
67
+ "description": "Should locate a different left to right word",
68
+ "property": "search",
69
+ "grid": [
70
+ "coffeelplx"
71
+ ],
72
+ "wordsToSearchFor": [
73
+ "coffee"
74
+ ],
75
+ "expected": {
76
+ "coffee": {
77
+ "start": {
78
+ "column": 1,
79
+ "row": 1
80
+ },
81
+ "end": {
82
+ "column": 6,
83
+ "row": 1
84
+ }
85
+ }
86
+ }
87
+ },
88
+ {
89
+ "description": "Should locate that different left to right word in a different position",
90
+ "property": "search",
91
+ "grid": [
92
+ "xcoffeezlp"
93
+ ],
94
+ "wordsToSearchFor": [
95
+ "coffee"
96
+ ],
97
+ "expected": {
98
+ "coffee": {
99
+ "start": {
100
+ "column": 2,
101
+ "row": 1
102
+ },
103
+ "end": {
104
+ "column": 7,
105
+ "row": 1
106
+ }
107
+ }
108
+ }
109
+ },
110
+ {
111
+ "description": "Should locate a left to right word in two line grid",
112
+ "property": "search",
113
+ "grid": [
114
+ "jefblpepre",
115
+ "tclojurerm"
116
+ ],
117
+ "wordsToSearchFor": [
118
+ "clojure"
119
+ ],
120
+ "expected": {
121
+ "clojure": {
122
+ "start": {
123
+ "column": 2,
124
+ "row": 2
125
+ },
126
+ "end": {
127
+ "column": 8,
128
+ "row": 2
129
+ }
130
+ }
131
+ }
132
+ },
133
+ {
134
+ "description": "Should locate a left to right word in three line grid",
135
+ "property": "search",
136
+ "grid": [
137
+ "camdcimgtc",
138
+ "jefblpepre",
139
+ "clojurermt"
140
+ ],
141
+ "wordsToSearchFor": [
142
+ "clojure"
143
+ ],
144
+ "expected": {
145
+ "clojure": {
146
+ "start": {
147
+ "column": 1,
148
+ "row": 3
149
+ },
150
+ "end": {
151
+ "column": 7,
152
+ "row": 3
153
+ }
154
+ }
155
+ }
156
+ },
157
+ {
158
+ "description": "Should locate a left to right word in ten line grid",
11
159
  "property": "search",
12
160
  "grid": [
13
161
  "jefblpepre",
@@ -38,7 +186,7 @@
38
186
  }
39
187
  },
40
188
  {
41
- "description": "Should locate words written right to left",
189
+ "description": "Should locate that left to right word in a different position in a ten line grid",
42
190
  "property": "search",
43
191
  "grid": [
44
192
  "jefblpepre",
@@ -49,13 +197,139 @@
49
197
  "wolcqlirpc",
50
198
  "screeaumgr",
51
199
  "alxhpburyi",
200
+ "clojurermt",
201
+ "jalaycalmp"
202
+ ],
203
+ "wordsToSearchFor": [
204
+ "clojure"
205
+ ],
206
+ "expected": {
207
+ "clojure": {
208
+ "start": {
209
+ "column": 1,
210
+ "row": 9
211
+ },
212
+ "end": {
213
+ "column": 7,
214
+ "row": 9
215
+ }
216
+ }
217
+ }
218
+ },
219
+ {
220
+ "description": "Should locate a different left to right word in a ten line grid",
221
+ "property": "search",
222
+ "grid": [
223
+ "jefblpepre",
224
+ "camdcimgtc",
225
+ "oivokprjsm",
226
+ "pbwasqroua",
227
+ "rixilelhrs",
228
+ "wolcqlirpc",
229
+ "fortranftw",
230
+ "alxhpburyi",
231
+ "clojurermt",
232
+ "jalaycalmp"
233
+ ],
234
+ "wordsToSearchFor": [
235
+ "fortran"
236
+ ],
237
+ "expected": {
238
+ "fortran": {
239
+ "start": {
240
+ "column": 1,
241
+ "row": 7
242
+ },
243
+ "end": {
244
+ "column": 7,
245
+ "row": 7
246
+ }
247
+ }
248
+ }
249
+ },
250
+ {
251
+ "description": "Should locate multiple words",
252
+ "property": "search",
253
+ "grid": [
254
+ "jefblpepre",
255
+ "camdcimgtc",
256
+ "oivokprjsm",
257
+ "pbwasqroua",
258
+ "rixilelhrs",
259
+ "wolcqlirpc",
260
+ "fortranftw",
261
+ "alxhpburyi",
52
262
  "jalaycalmp",
53
263
  "clojurermt"
54
264
  ],
55
265
  "wordsToSearchFor": [
56
- "clojure",
266
+ "fortran",
267
+ "clojure"
268
+ ],
269
+ "expected": {
270
+ "clojure": {
271
+ "start": {
272
+ "column": 1,
273
+ "row": 10
274
+ },
275
+ "end": {
276
+ "column": 7,
277
+ "row": 10
278
+ }
279
+ },
280
+ "fortran": {
281
+ "start": {
282
+ "column": 1,
283
+ "row": 7
284
+ },
285
+ "end": {
286
+ "column": 7,
287
+ "row": 7
288
+ }
289
+ }
290
+ }
291
+ },
292
+ {
293
+ "description": "Should locate a single word written right to left",
294
+ "property": "search",
295
+ "grid": [
296
+ "rixilelhrs"
297
+ ],
298
+ "wordsToSearchFor": [
57
299
  "elixir"
58
300
  ],
301
+ "expected": {
302
+ "elixir": {
303
+ "start": {
304
+ "column": 6,
305
+ "row": 1
306
+ },
307
+ "end": {
308
+ "column": 1,
309
+ "row": 1
310
+ }
311
+ }
312
+ }
313
+ },
314
+ {
315
+ "description": "Should locate multiple words written in different horizontal directions",
316
+ "property": "search",
317
+ "grid": [
318
+ "jefblpepre",
319
+ "camdcimgtc",
320
+ "oivokprjsm",
321
+ "pbwasqroua",
322
+ "rixilelhrs",
323
+ "wolcqlirpc",
324
+ "screeaumgr",
325
+ "alxhpburyi",
326
+ "jalaycalmp",
327
+ "clojurermt"
328
+ ],
329
+ "wordsToSearchFor": [
330
+ "elixir",
331
+ "clojure"
332
+ ],
59
333
  "expected": {
60
334
  "clojure": {
61
335
  "start": {
@@ -124,22 +124,6 @@ int main(void)
124
124
  {
125
125
  UnityBegin("raindrops.c");
126
126
 
127
- RUN_TEST(test_one_yields_itself);
128
- RUN_TEST(test_three_yields_pling);
129
- RUN_TEST(test_five_yields_plang);
130
- RUN_TEST(test_seven_yields_plong);
131
- RUN_TEST(test_six_yields_pling);
132
- RUN_TEST(test_nine_yields_pling);
133
- RUN_TEST(test_ten_yields_plang);
134
- RUN_TEST(test_fourteen_yields_plong);
135
- RUN_TEST(test_fifteen_yields_plingplang);
136
- RUN_TEST(test_twenty_one_yields_plingplong);
137
- RUN_TEST(test_twenty_five_yields_plang);
138
- RUN_TEST(test_thirty_five_yields_plangplong);
139
- RUN_TEST(test_forty_nine_yields_plong);
140
- RUN_TEST(test_fifty_two_yields_itself);
141
- RUN_TEST(test_one_hundred_five_yields_plingplangplong);
142
- RUN_TEST(test_big_prime_yields_itself);
143
127
  RUN_TEST(test_one_yields_itself);
144
128
  RUN_TEST(test_three_yields_pling);
145
129
  RUN_TEST(test_five_yields_plang);
@@ -141,7 +141,7 @@ As mentioned above, we used parameterized tests since this avoids test code dupl
141
141
 
142
142
  Unfortunately, since by default all cases are enabled, this runs counter to the usual Exercism style in which only a *single test case* is enabled, and the student enables one more test case after making the previous one pass, taking an iterative process.
143
143
 
144
- The [ignore annotation](https://modules.ceylon-lang.org/repo/1/ceylon/test/1.3.2/module-doc/api/index.html#ignore) does not seem like it can be applied to individual cases of a parameterized test.
144
+ The [ignore annotation](https://modules.ceylon-lang.org/repo/1/ceylon/test/1.3.3/module-doc/api/index.html#ignore) does not seem like it can be applied to individual cases of a parameterized test.
145
145
 
146
146
  One possible solution to this would be to comment out all cases except the first.
147
147
  If this solution were taken, students would need to be aware of this, and be informed that they need to uncomment the cases.
@@ -34,6 +34,18 @@
34
34
  "Mathematics"
35
35
  ]
36
36
  },
37
+ {
38
+ "uuid": "bc986de4-62f7-439a-a144-fb8fdbdf4d30",
39
+ "slug": "rna-transcription",
40
+ "core": false,
41
+ "unlocked_by": null,
42
+ "difficulty": 3,
43
+ "topics": [
44
+ "Strings",
45
+ "Parsing",
46
+ "Transforming"
47
+ ]
48
+ },
37
49
  {
38
50
  "uuid": "fe43a5a0-9f83-45ab-af37-76f8a3e84393",
39
51
  "slug": "anagram",
@@ -1,5 +1,5 @@
1
1
  * [Language specification](https://www.ceylon-lang.org/documentation/1.3/spec/)
2
2
  * [Reference](https://www.ceylon-lang.org/documentation/1.3/reference/)
3
- * [API documentation for the `language` module](https://modules.ceylon-lang.org/repo/1/ceylon/language/1.3.2/module-doc/api/index.html)
3
+ * [API documentation for the `language` module](https://modules.ceylon-lang.org/repo/1/ceylon/language/1.3.3/module-doc/api/index.html)
4
4
  * [Examples](https://www.ceylon-lang.org/documentation/1.3/examples/)
5
5
  * [Community page](https://www.ceylon-lang.org/community/)
@@ -1,6 +1,6 @@
1
1
  import ceylon.test { ... }
2
2
 
3
- // Tests adapted from x-common version 1.0.1
3
+ // Tests adapted from problem-specifications version 1.0.1
4
4
  {[String, {String*}, {String*}]*} cases => {
5
5
  // no matches
6
6
  ["diaper", {"hello", "world", "zombies", "pants"}, {}],
@@ -1,3 +1,3 @@
1
1
  module anagram "1.0" {
2
- import "ceylon.test" "1.3.2";
2
+ import "ceylon.test" "1.3.3";
3
3
  }
@@ -1,4 +1,4 @@
1
1
  module bracketpush "1.0" {
2
- import "ceylon.collection" "1.3.2";
3
- import "ceylon.test" "1.3.2";
2
+ import "ceylon.collection" "1.3.3";
3
+ import "ceylon.test" "1.3.3";
4
4
  }
@@ -1,6 +1,6 @@
1
1
  import ceylon.test { ... }
2
2
 
3
- // Tests adapted from x-common version 1.1.0
3
+ // Tests adapted from problem-specifications version 1.1.0
4
4
  {[String, Boolean]*} cases => {
5
5
  // paired square brackets
6
6
  ["[]", true],
@@ -1,3 +1,3 @@
1
1
  module bracketpush "1.0" {
2
- import "ceylon.test" "1.3.2";
2
+ import "ceylon.test" "1.3.3";
3
3
  }
@@ -1,6 +1,6 @@
1
1
  import ceylon.test { ... }
2
2
 
3
- // Tests adapted from x-common version 1.0.0
3
+ // Tests adapted from problem-specifications version 1.0.0
4
4
  {[String, String, Integer?]*} cases => {
5
5
  // identical strands
6
6
  ["A", "A", 0],
@@ -1,3 +1,3 @@
1
1
  module hamming "1.0" {
2
- import "ceylon.test" "1.3.2";
2
+ import "ceylon.test" "1.3.3";
3
3
  }
@@ -1,6 +1,6 @@
1
1
  import ceylon.test { ... }
2
2
 
3
- // Tests adapted from x-common version 1.0.0
3
+ // Tests adapted from problem-specifications version 1.0.0
4
4
  {[String, Integer, Integer?]*} cases => {
5
5
  // finds the largest product if span equals length
6
6
  ["29", 2, 18],
@@ -1,3 +1,3 @@
1
1
  module largestseriesproduct "1.0" {
2
- import "ceylon.test" "1.3.2";
2
+ import "ceylon.test" "1.3.3";
3
3
  }
@@ -1,6 +1,6 @@
1
1
  import ceylon.test { ... }
2
2
 
3
- // Tests adapted from x-common version 1.0.0
3
+ // Tests adapted from problem-specifications version 1.0.0
4
4
  {[Integer, Boolean]*} cases =>
5
5
  {[2015, false], [2016, true], [2100, false], [2000, true]};
6
6
 
@@ -1,3 +1,3 @@
1
1
  module leap "1.0" {
2
- import "ceylon.test" "1.3.2";
2
+ import "ceylon.test" "1.3.3";
3
3
  }
@@ -1,4 +1,4 @@
1
1
  module react "1.0" {
2
- import "ceylon.collection" "1.3.2";
3
- import "ceylon.test" "1.3.2";
2
+ import "ceylon.collection" "1.3.3";
3
+ import "ceylon.test" "1.3.3";
4
4
  }
@@ -1,6 +1,6 @@
1
1
  import ceylon.test { ... }
2
2
 
3
- // Tests adapted from x-common version 1.0.0
3
+ // Tests adapted from problem-specifications version 1.0.0
4
4
 
5
5
  test
6
6
  void inputCellsHaveValue() {
@@ -1,3 +1,3 @@
1
1
  module react "1.0" {
2
- import "ceylon.test" "1.3.2";
2
+ import "ceylon.test" "1.3.3";
3
3
  }
@@ -0,0 +1,41 @@
1
+ # RNA Transcription
2
+
3
+ Given a DNA strand, return its RNA complement (per RNA transcription).
4
+
5
+ Both DNA and RNA strands are a sequence of nucleotides.
6
+
7
+ The four nucleotides found in DNA are adenine (**A**), cytosine (**C**),
8
+ guanine (**G**) and thymine (**T**).
9
+
10
+ The four nucleotides found in RNA are adenine (**A**), cytosine (**C**),
11
+ guanine (**G**) and uracil (**U**).
12
+
13
+ Given a DNA strand, its transcribed RNA strand is formed by replacing
14
+ each nucleotide with its complement:
15
+
16
+ * `G` -> `C`
17
+ * `C` -> `G`
18
+ * `T` -> `A`
19
+ * `A` -> `U`
20
+
21
+ ## Running Ceylon Tests
22
+
23
+ Before tests can be run, your code must be compiled via [`ceylon compile`](https://ceylon-lang.org/documentation/current/reference/tool/ceylon/subcommands/ceylon-compile.html).
24
+
25
+ We run tests with the [`ceylon test`](https://ceylon-lang.org/documentation/reference/tool/ceylon/subcommands/ceylon-test.html) command.
26
+
27
+ `ceylon test` expects a module name to run the tests on.
28
+ In the Ceylon track, each exercise has just a single module.
29
+
30
+ Therefore, you can run the tests with:
31
+
32
+ ```bash
33
+ ceylon compile && ceylon test $(basename source/*)
34
+ ```
35
+
36
+ ## Source
37
+
38
+ Rosalind [http://rosalind.info/problems/rna](http://rosalind.info/problems/rna)
39
+
40
+ ## Submitting Incomplete Solutions
41
+ It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -0,0 +1,13 @@
1
+ class Error() {}
2
+
3
+ String|Error transcription(String dna) {
4
+ return dna.fold("" of String|Error)((String|Error r,
5
+ Character c) => if (is Error r)
6
+ then (r)
7
+ else (switch (c)
8
+ case ('G') r + "C"
9
+ case ('C') r + "G"
10
+ case ('T') r + "A"
11
+ case ('A') r + "U"
12
+ else (Error())));
13
+ }
@@ -0,0 +1,5 @@
1
+ class Error() {}
2
+
3
+ String|Error transcription(String dna) {
4
+ return nothing;
5
+ }
@@ -0,0 +1,33 @@
1
+ import ceylon.test { ... }
2
+
3
+ // Tests adapted from problem-specifications version 1.0.1
4
+ {[String, String|Null]*} cases => {
5
+ // empty strand
6
+ ["", ""],
7
+ // single C nucleotide strand
8
+ ["C", "G"],
9
+ // single G nucleotide strand
10
+ ["G", "C"],
11
+ // single A nucleotide strand
12
+ ["A", "U"],
13
+ // single T nucleotide strand
14
+ ["T", "A"],
15
+ // longer strand
16
+ ["ACGTGGTCTTAA", "UGCACCAGAAUU"],
17
+ // strand with DNA nucleotides
18
+ ["U", null],
19
+ // strand with invalid nucleotides
20
+ ["XCGFGGTDTTAA", null],
21
+ // strand with invalid nucleotides after the first nucleotide
22
+ ["ACGTFGTBTEAA", null]
23
+ };
24
+
25
+ test
26
+ parameters(`value cases`)
27
+ void testHamming(String dna, String|Null expected) {
28
+ if (exists expected) {
29
+ assertEquals(transcription(dna), expected);
30
+ } else if (!is Error result = transcription(dna)) {
31
+ fail("should have errored, but got ``result``");
32
+ }
33
+ }
@@ -0,0 +1,3 @@
1
+ module rnatranscription "1.0" {
2
+ import "ceylon.test" "1.3.3";
3
+ }
@@ -1,4 +1,4 @@
1
1
  module sieve "1.0" {
2
- import "ceylon.numeric" "1.3.2";
3
- import "ceylon.test" "1.3.2";
2
+ import "ceylon.numeric" "1.3.3";
3
+ import "ceylon.test" "1.3.3";
4
4
  }
@@ -1,6 +1,6 @@
1
1
  import ceylon.test { ... }
2
2
 
3
- // Tests adapted from x-common version 1.0.0
3
+ // Tests adapted from problem-specifications version 1.0.0
4
4
  {Integer*} cases => {1, 2, 10, 13, 1000};
5
5
 
6
6
  [Integer+] primes1000 = [
@@ -1,3 +1,3 @@
1
1
  module sieve "1.0" {
2
- import "ceylon.test" "1.3.2";
2
+ import "ceylon.test" "1.3.3";
3
3
  }
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  language: clojure
3
3
  sudo: false
4
- lein: lein2
4
+ lein: lein
5
5
  jdk: oraclejdk8
6
6
  script:
7
7
  - bin/fetch-configlet
@@ -62,7 +62,7 @@
62
62
  (defn -main
63
63
  "Uses the test template for the exercise and test data to generate test cases."
64
64
  [exercise-name & args]
65
- (let [test-template-path (format "exercises/%s/%s.mustache" exercise-name exercise-name)
65
+ (let [test-template-path (format "exercises/%s/.meta/%s.mustache" exercise-name exercise-name)
66
66
  test-data (load-test-data exercise-name)]
67
67
  (if (file-exists? test-template-path)
68
68
  (do