trackler 2.2.1.74 → 2.2.1.75

Sign up to get free protection for your applications and to get access to all the features.
Files changed (227) hide show
  1. checksums.yaml +4 -4
  2. data/fixtures/tracks/fruit/docs/something.md +0 -0
  3. data/lib/trackler/version.rb +1 -1
  4. data/problem-specifications/README.md +8 -4
  5. data/problem-specifications/exercises/acronym/canonical-data.json +19 -7
  6. data/problem-specifications/exercises/all-your-base/canonical-data.json +106 -64
  7. data/problem-specifications/exercises/allergies/canonical-data.json +37 -13
  8. data/tracks/c/config.json +176 -176
  9. data/tracks/clojure/config.json +17 -1
  10. data/tracks/clojure/exercises/isbn-verifier/README.md +43 -0
  11. data/tracks/clojure/exercises/isbn-verifier/project.clj +4 -0
  12. data/tracks/clojure/exercises/isbn-verifier/src/example.clj +17 -0
  13. data/tracks/clojure/exercises/isbn-verifier/src/isbn_verifier.clj +3 -0
  14. data/tracks/clojure/exercises/isbn-verifier/test/isbn_verifier_test.clj +42 -0
  15. data/tracks/clojure/exercises/proverb/README.md +15 -0
  16. data/tracks/clojure/exercises/proverb/project.clj +4 -0
  17. data/tracks/clojure/exercises/proverb/src/example.clj +15 -0
  18. data/tracks/clojure/exercises/proverb/src/proverb.clj +3 -0
  19. data/tracks/clojure/exercises/proverb/test/proverb_test.clj +14 -0
  20. data/tracks/common-lisp/docs/LEARNING.md +4 -3
  21. data/tracks/common-lisp/docs/RESOURCES.md +11 -0
  22. data/tracks/delphi/.gitignore +1 -0
  23. data/tracks/delphi/config.json +24 -0
  24. data/tracks/delphi/docs/INSTALLATION.md +1 -1
  25. data/tracks/delphi/exercises/isbn-verifier/ISBNVerifier.dpr +60 -0
  26. data/tracks/delphi/exercises/isbn-verifier/README.md +68 -0
  27. data/tracks/delphi/exercises/isbn-verifier/uISBNVerifierExample.pas +46 -0
  28. data/tracks/delphi/exercises/isbn-verifier/uTestISBNVerifier.pas +136 -0
  29. data/tracks/delphi/exercises/secret-handshake/README.md +56 -0
  30. data/tracks/delphi/exercises/secret-handshake/SecretHandshake.dpr +60 -0
  31. data/tracks/delphi/exercises/secret-handshake/uSecretHandshakeExample.pas +56 -0
  32. data/tracks/delphi/exercises/secret-handshake/uTestSecretHandshake.pas +215 -0
  33. data/tracks/ecmascript/docs/ABOUT.md +13 -9
  34. data/tracks/factor/exercises/two-fer/README.md +1 -1
  35. data/tracks/fsharp/docs/RESOURCES.md +1 -1
  36. data/tracks/fsharp/generators/{Input.fs → CanonicalData.fs} +5 -10
  37. data/tracks/fsharp/generators/Exercise.fs +11 -10
  38. data/tracks/fsharp/generators/{Output.fs → Formatting.fs} +2 -56
  39. data/tracks/fsharp/generators/Generators.fs +93 -93
  40. data/tracks/fsharp/generators/Generators.fsproj +9 -4
  41. data/tracks/fsharp/generators/Options.fs +1 -1
  42. data/tracks/fsharp/generators/Program.fs +3 -3
  43. data/tracks/fsharp/generators/Rendering.fs +57 -0
  44. data/tracks/go/exercises/all-your-base/.meta/gen.go +80 -0
  45. data/tracks/go/exercises/all-your-base/.meta/hints.md +13 -0
  46. data/tracks/go/exercises/all-your-base/README.md +16 -1
  47. data/tracks/go/exercises/all-your-base/all_your_base_test.go +12 -163
  48. data/tracks/go/exercises/all-your-base/cases_test.go +183 -0
  49. data/tracks/go/exercises/all-your-base/example.go +25 -29
  50. data/tracks/java/CONTRIBUTING.md +1 -1
  51. data/tracks/java/POLICIES.md +15 -1
  52. data/tracks/java/exercises/flatten-array/.meta/hints.md +58 -0
  53. data/tracks/java/exercises/flatten-array/README.md +62 -0
  54. data/tracks/java/exercises/hamming/src/main/java/Hamming.java +1 -1
  55. data/tracks/java/exercises/matrix/.meta/src/reference/java/Matrix.java +6 -6
  56. data/tracks/java/exercises/meetup/.meta/src/reference/java/Meetup.java +2 -2
  57. data/tracks/java/exercises/meetup/.meta/src/reference/java/MeetupSchedule.java +1 -1
  58. data/tracks/java/exercises/meetup/src/main/java/MeetupSchedule.java +1 -1
  59. data/tracks/java/exercises/pig-latin/.meta/hints.md +58 -0
  60. data/tracks/java/exercises/pig-latin/README.md +61 -0
  61. data/tracks/java/exercises/reverse-string/src/main/java/ReverseString.java +2 -2
  62. data/tracks/java/exercises/secret-handshake/README.md +1 -1
  63. data/tracks/javascript/.eslintignore +0 -3
  64. data/tracks/javascript/exercises/food-chain/example.js +50 -37
  65. data/tracks/javascript/exercises/octal/example.js +1 -1
  66. data/tracks/javascript/exercises/robot-name/robot-name.spec.js +7 -7
  67. data/tracks/javascript/package-lock.json +1846 -0
  68. data/tracks/python/docs/EXERCISE_README_INSERT.md +15 -0
  69. data/tracks/python/exercises/accumulate/README.md +15 -0
  70. data/tracks/python/exercises/acronym/README.md +15 -0
  71. data/tracks/python/exercises/all-your-base/README.md +15 -0
  72. data/tracks/python/exercises/all-your-base/all_your_base_test.py +19 -9
  73. data/tracks/python/exercises/allergies/README.md +15 -0
  74. data/tracks/python/exercises/alphametics/README.md +15 -0
  75. data/tracks/python/exercises/anagram/README.md +15 -0
  76. data/tracks/python/exercises/atbash-cipher/README.md +15 -0
  77. data/tracks/python/exercises/beer-song/README.md +16 -1
  78. data/tracks/python/exercises/binary-search-tree/README.md +16 -2
  79. data/tracks/python/exercises/binary-search/README.md +15 -0
  80. data/tracks/python/exercises/binary-search/binary_search_test.py +14 -4
  81. data/tracks/python/exercises/binary/README.md +15 -0
  82. data/tracks/python/exercises/binary/binary_test.py +14 -4
  83. data/tracks/python/exercises/bob/README.md +15 -0
  84. data/tracks/python/exercises/book-store/README.md +15 -0
  85. data/tracks/python/exercises/bracket-push/README.md +15 -0
  86. data/tracks/python/exercises/change/README.md +15 -0
  87. data/tracks/python/exercises/circular-buffer/README.md +15 -0
  88. data/tracks/python/exercises/circular-buffer/circular_buffer_test.py +15 -5
  89. data/tracks/python/exercises/circular-buffer/example.py +2 -2
  90. data/tracks/python/exercises/clock/README.md +15 -0
  91. data/tracks/python/exercises/collatz-conjecture/.meta/hints.md +1 -1
  92. data/tracks/python/exercises/collatz-conjecture/README.md +15 -0
  93. data/tracks/python/exercises/complex-numbers/README.md +15 -0
  94. data/tracks/python/exercises/connect/README.md +18 -3
  95. data/tracks/python/exercises/crypto-square/README.md +15 -0
  96. data/tracks/python/exercises/diamond/README.md +15 -0
  97. data/tracks/python/exercises/difference-of-squares/README.md +15 -0
  98. data/tracks/python/exercises/diffie-hellman/README.md +14 -0
  99. data/tracks/python/exercises/dominoes/README.md +16 -1
  100. data/tracks/python/exercises/error-handling/README.md +17 -0
  101. data/tracks/python/exercises/error-handling/error_handling_test.py +13 -3
  102. data/tracks/python/exercises/error-handling/example.py +1 -1
  103. data/tracks/python/exercises/etl/README.md +16 -1
  104. data/tracks/python/exercises/flatten-array/README.md +15 -0
  105. data/tracks/python/exercises/food-chain/README.md +15 -0
  106. data/tracks/python/exercises/forth/README.md +15 -0
  107. data/tracks/python/exercises/forth/example.py +7 -9
  108. data/tracks/python/exercises/forth/forth_test.py +107 -17
  109. data/tracks/python/exercises/gigasecond/README.md +15 -0
  110. data/tracks/python/exercises/go-counting/README.md +21 -3
  111. data/tracks/python/exercises/grade-school/README.md +15 -0
  112. data/tracks/python/exercises/grains/README.md +15 -0
  113. data/tracks/python/exercises/grains/grains_test.py +16 -6
  114. data/tracks/python/exercises/grep/README.md +15 -0
  115. data/tracks/python/exercises/hamming/README.md +15 -0
  116. data/tracks/python/exercises/hamming/hamming_test.py +12 -2
  117. data/tracks/python/exercises/hello-world/README.md +15 -0
  118. data/tracks/python/exercises/hexadecimal/README.md +15 -0
  119. data/tracks/python/exercises/hexadecimal/hexadecimal_test.py +11 -1
  120. data/tracks/python/exercises/house/README.md +16 -1
  121. data/tracks/python/exercises/isogram/README.md +15 -0
  122. data/tracks/python/exercises/kindergarten-garden/README.md +18 -3
  123. data/tracks/python/exercises/largest-series-product/README.md +15 -0
  124. data/tracks/python/exercises/largest-series-product/largest_series_product_test.py +14 -4
  125. data/tracks/python/exercises/leap/README.md +15 -0
  126. data/tracks/python/exercises/linked-list/README.md +15 -0
  127. data/tracks/python/exercises/list-ops/README.md +15 -0
  128. data/tracks/python/exercises/luhn/README.md +15 -0
  129. data/tracks/python/exercises/markdown/README.md +18 -0
  130. data/tracks/python/exercises/matrix/README.md +15 -0
  131. data/tracks/python/exercises/meetup/README.md +31 -12
  132. data/tracks/python/exercises/meetup/meetup_test.py +11 -1
  133. data/tracks/python/exercises/minesweeper/README.md +15 -0
  134. data/tracks/python/exercises/minesweeper/minesweeper_test.py +12 -2
  135. data/tracks/python/exercises/nth-prime/README.md +15 -0
  136. data/tracks/python/exercises/nth-prime/nth_prime_test.py +11 -1
  137. data/tracks/python/exercises/nucleotide-count/README.md +17 -2
  138. data/tracks/python/exercises/nucleotide-count/nucleotide_count_test.py +11 -1
  139. data/tracks/python/exercises/ocr-numbers/README.md +16 -1
  140. data/tracks/python/exercises/ocr-numbers/ocr_numbers_test.py +12 -2
  141. data/tracks/python/exercises/octal/README.md +15 -0
  142. data/tracks/python/exercises/octal/octal_test.py +16 -3
  143. data/tracks/python/exercises/palindrome-products/README.md +16 -1
  144. data/tracks/python/exercises/pangram/README.md +15 -0
  145. data/tracks/python/exercises/pascals-triangle/README.md +16 -1
  146. data/tracks/python/exercises/perfect-numbers/README.md +15 -0
  147. data/tracks/python/exercises/perfect-numbers/perfect_numbers_test.py +13 -3
  148. data/tracks/python/exercises/phone-number/README.md +16 -2
  149. data/tracks/python/exercises/phone-number/example.py +1 -1
  150. data/tracks/python/exercises/phone-number/phone_number_test.py +17 -7
  151. data/tracks/python/exercises/pig-latin/README.md +15 -0
  152. data/tracks/python/exercises/point-mutations/README.md +15 -0
  153. data/tracks/python/exercises/poker/README.md +15 -0
  154. data/tracks/python/exercises/pov/README.md +20 -2
  155. data/tracks/python/exercises/pov/example.py +2 -2
  156. data/tracks/python/exercises/pov/pov_test.py +15 -5
  157. data/tracks/python/exercises/prime-factors/README.md +15 -0
  158. data/tracks/python/exercises/protein-translation/README.md +15 -0
  159. data/tracks/python/exercises/protein-translation/protein_translation_test.py +10 -0
  160. data/tracks/python/exercises/proverb/README.md +14 -0
  161. data/tracks/python/exercises/pythagorean-triplet/README.md +15 -0
  162. data/tracks/python/exercises/pythagorean-triplet/pythagorean_triplet_test.py +11 -1
  163. data/tracks/python/exercises/queen-attack/README.md +15 -0
  164. data/tracks/python/exercises/queen-attack/queen_attack_test.py +17 -7
  165. data/tracks/python/exercises/rail-fence-cipher/README.md +15 -0
  166. data/tracks/python/exercises/raindrops/README.md +15 -0
  167. data/tracks/python/exercises/react/README.md +15 -1
  168. data/tracks/python/exercises/rectangles/README.md +24 -9
  169. data/tracks/python/exercises/rna-transcription/.meta/hints.md +1 -0
  170. data/tracks/python/exercises/rna-transcription/README.md +18 -5
  171. data/tracks/python/exercises/rna-transcription/rna_transcription_test.py +13 -3
  172. data/tracks/python/exercises/robot-name/README.md +15 -0
  173. data/tracks/python/exercises/robot-simulator/README.md +15 -0
  174. data/tracks/python/exercises/roman-numerals/README.md +15 -0
  175. data/tracks/python/exercises/rotational-cipher/README.md +15 -0
  176. data/tracks/python/exercises/run-length-encoding/README.md +15 -0
  177. data/tracks/python/exercises/saddle-points/README.md +15 -0
  178. data/tracks/python/exercises/saddle-points/saddle_points_test.py +11 -1
  179. data/tracks/python/exercises/say/README.md +15 -0
  180. data/tracks/python/exercises/say/say_test.py +12 -2
  181. data/tracks/python/exercises/scale-generator/README.md +15 -0
  182. data/tracks/python/exercises/scale-generator/example.py +3 -3
  183. data/tracks/python/exercises/scale-generator/scale_generator_test.py +11 -1
  184. data/tracks/python/exercises/scrabble-score/README.md +15 -0
  185. data/tracks/python/exercises/secret-handshake/README.md +16 -1
  186. data/tracks/python/exercises/series/README.md +15 -0
  187. data/tracks/python/exercises/series/series_test.py +12 -2
  188. data/tracks/python/exercises/sieve/README.md +15 -0
  189. data/tracks/python/exercises/simple-cipher/.meta/hints.md +6 -6
  190. data/tracks/python/exercises/simple-cipher/README.md +17 -1
  191. data/tracks/python/exercises/simple-cipher/simple_cipher_test.py +12 -2
  192. data/tracks/python/exercises/simple-linked-list/{hints.md → .meta/hints.md} +10 -10
  193. data/tracks/python/exercises/simple-linked-list/README.md +16 -0
  194. data/tracks/python/exercises/simple-linked-list/example.py +2 -2
  195. data/tracks/python/exercises/simple-linked-list/simple_linked_list_test.py +13 -3
  196. data/tracks/python/exercises/space-age/README.md +15 -0
  197. data/tracks/python/exercises/strain/README.md +16 -3
  198. data/tracks/python/exercises/sublist/README.md +15 -0
  199. data/tracks/python/exercises/sum-of-multiples/README.md +18 -3
  200. data/tracks/python/exercises/tournament/README.md +15 -0
  201. data/tracks/python/exercises/transpose/README.md +15 -0
  202. data/tracks/python/exercises/tree-building/README.md +30 -0
  203. data/tracks/python/exercises/tree-building/example.py +3 -5
  204. data/tracks/python/exercises/tree-building/tree_building_test.py +16 -6
  205. data/tracks/python/exercises/triangle/README.md +15 -0
  206. data/tracks/python/exercises/triangle/example.py +1 -1
  207. data/tracks/python/exercises/triangle/triangle_test.py +15 -5
  208. data/tracks/python/exercises/trinary/README.md +15 -0
  209. data/tracks/python/exercises/twelve-days/README.md +15 -0
  210. data/tracks/python/exercises/two-bucket/README.md +22 -7
  211. data/tracks/python/exercises/two-fer/README.md +16 -0
  212. data/tracks/python/exercises/variable-length-quantity/README.md +15 -0
  213. data/tracks/python/exercises/variable-length-quantity/variable_length_quantity_test.py +12 -2
  214. data/tracks/python/exercises/word-count/README.md +15 -0
  215. data/tracks/python/exercises/word-search/README.md +15 -0
  216. data/tracks/python/exercises/wordy/README.md +15 -0
  217. data/tracks/python/exercises/wordy/wordy_test.py +14 -4
  218. data/tracks/python/exercises/zebra-puzzle/README.md +15 -0
  219. data/tracks/python/exercises/zipper/README.md +16 -3
  220. data/tracks/rust/config.json +11 -0
  221. data/tracks/rust/exercises/saddle-points/.gitignore +8 -0
  222. data/tracks/rust/exercises/saddle-points/Cargo.toml +5 -0
  223. data/tracks/rust/exercises/saddle-points/README.md +66 -0
  224. data/tracks/rust/exercises/saddle-points/example.rs +24 -0
  225. data/tracks/rust/exercises/saddle-points/src/lib.rs +3 -0
  226. data/tracks/rust/exercises/saddle-points/tests/saddle-points.rs +60 -0
  227. metadata +38 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7a7b4624cf3983efc89bfe64c619f3b279d50de1
4
- data.tar.gz: b8e4bbc0f9f8272c855fbea003cdc30195a2288f
3
+ metadata.gz: 80d9ad73937e82f0b192f04c668850da9e314fbc
4
+ data.tar.gz: 3eb23d8619d0d5c8059a1793d64e8b482e7dea52
5
5
  SHA512:
6
- metadata.gz: ec2977ea8d584e80be5ed3cd8ceccfa35c1a69d5af7cffe379cda9f6b600dc83f3e08a65a981ee013c6e8efeaaa8655f34ce32b8a4ba242e863c0aa1fb197d90
7
- data.tar.gz: dc9f246584ced43eeeeeb2676567b02015f6b03176a58c329694035cfed04bbe62a9db03c10421c993e2a83e51f072b6e95069ae913bfd348f012008bbbf2a44
6
+ metadata.gz: 5edf73f1a9cb08b3bb438651bc1752af1bd024b59af89ce6f780b5fd068574a56e2de7825e1d10eebc0284bf0109408c1538ea1bc97cbd633497f137a80c9810
7
+ data.tar.gz: 02a9704e07f1cdbd57c72b4b33cfd7838ecbe42f8d8bff1cbd0a580b07d81c003b5a1c214429b95190b787f8c65f82c1e04191f62979d16bb4b1e794817d7e8c
@@ -1,3 +1,3 @@
1
1
  module Trackler
2
- VERSION = "2.2.1.74"
2
+ VERSION = "2.2.1.75"
3
3
  end
@@ -71,8 +71,10 @@ is easier to understand with an example:
71
71
  }
72
72
  , { "description": "Bar'ing a name returns its parts combined"
73
73
  , "property" : "bar"
74
- , "firstName" : "Alan"
75
- , "lastName" : "Smithee"
74
+ , "input" : {
75
+ "firstName" : "Alan",
76
+ "lastName" : "Smithee"
77
+ }
76
78
  , "expected" : "ASlmainthee"
77
79
  }
78
80
  , { "comments":
@@ -88,8 +90,10 @@ is easier to understand with an example:
88
90
  }
89
91
  , { "description": "Bar'ing a name with numbers gives an error"
90
92
  , "property" : "bar"
91
- , "firstName" : "HAL"
92
- , "lastName" : "9000"
93
+ , "input" : {
94
+ "firstName" : "HAL",
95
+ "lastName" : "9000"
96
+ }
93
97
  , "expected" : { "error": "You should never bar a number" }
94
98
  }
95
99
  ]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "exercise": "acronym",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "cases": [
5
5
  {
6
6
  "description": "Abbreviate a phrase",
@@ -8,37 +8,49 @@
8
8
  {
9
9
  "description": "basic",
10
10
  "property": "abbreviate",
11
- "phrase": "Portable Network Graphics",
11
+ "input": {
12
+ "phrase": "Portable Network Graphics"
13
+ },
12
14
  "expected": "PNG"
13
15
  },
14
16
  {
15
17
  "description": "lowercase words",
16
18
  "property": "abbreviate",
17
- "phrase": "Ruby on Rails",
19
+ "input": {
20
+ "phrase": "Ruby on Rails"
21
+ },
18
22
  "expected": "ROR"
19
23
  },
20
24
  {
21
25
  "description": "punctuation",
22
26
  "property": "abbreviate",
23
- "phrase": "First In, First Out",
27
+ "input": {
28
+ "phrase": "First In, First Out"
29
+ },
24
30
  "expected": "FIFO"
25
31
  },
26
32
  {
27
33
  "description": "all caps words",
28
34
  "property": "abbreviate",
29
- "phrase": "PHP: Hypertext Preprocessor",
35
+ "input": {
36
+ "phrase": "PHP: Hypertext Preprocessor"
37
+ },
30
38
  "expected": "PHP"
31
39
  },
32
40
  {
33
41
  "description": "non-acronym all caps word",
34
42
  "property": "abbreviate",
35
- "phrase": "GNU Image Manipulation Program",
43
+ "input": {
44
+ "phrase": "GNU Image Manipulation Program"
45
+ },
36
46
  "expected": "GIMP"
37
47
  },
38
48
  {
39
49
  "description": "hyphenated",
40
50
  "property": "abbreviate",
41
- "phrase": "Complementary metal-oxide semiconductor",
51
+ "input": {
52
+ "phrase": "Complementary metal-oxide semiconductor"
53
+ },
42
54
  "expected": "CMOS"
43
55
  }
44
56
  ]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "exercise": "all-your-base",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "comments": [
5
5
  "This canonical data makes the following choices:",
6
6
  "1. Zero is always represented in outputs as [0] instead of [].",
@@ -16,169 +16,211 @@
16
16
  {
17
17
  "description": "single bit one to decimal",
18
18
  "property": "rebase",
19
- "input_base": 2,
20
- "input_digits": [1],
21
- "output_base": 10,
19
+ "input": {
20
+ "input_base": 2,
21
+ "digits": [1],
22
+ "output_base": 10
23
+ },
22
24
  "expected": [1]
23
25
  },
24
26
  {
25
27
  "description": "binary to single decimal",
26
28
  "property": "rebase",
27
- "input_base": 2,
28
- "input_digits": [1, 0, 1],
29
- "output_base": 10,
29
+ "input": {
30
+ "input_base": 2,
31
+ "digits": [1, 0, 1],
32
+ "output_base": 10
33
+ },
30
34
  "expected": [5]
31
35
  },
32
36
  {
33
37
  "description": "single decimal to binary",
34
38
  "property": "rebase",
35
- "input_base": 10,
36
- "input_digits": [5],
37
- "output_base": 2,
39
+ "input": {
40
+ "input_base": 10,
41
+ "digits": [5],
42
+ "output_base": 2
43
+ },
38
44
  "expected": [1, 0, 1]
39
45
  },
40
46
  {
41
47
  "description": "binary to multiple decimal",
42
48
  "property": "rebase",
43
- "input_base": 2,
44
- "input_digits": [1, 0, 1, 0, 1, 0],
45
- "output_base": 10,
49
+ "input": {
50
+ "input_base": 2,
51
+ "digits": [1, 0, 1, 0, 1, 0],
52
+ "output_base": 10
53
+ },
46
54
  "expected": [4, 2]
47
55
  },
48
56
  {
49
57
  "description": "decimal to binary",
50
58
  "property": "rebase",
51
- "input_base": 10,
52
- "input_digits": [4, 2],
53
- "output_base": 2,
59
+ "input": {
60
+ "input_base": 10,
61
+ "digits": [4, 2],
62
+ "output_base": 2
63
+ },
54
64
  "expected": [1, 0, 1, 0, 1, 0]
55
65
  },
56
66
  {
57
67
  "description": "trinary to hexadecimal",
58
68
  "property": "rebase",
59
- "input_base": 3,
60
- "input_digits": [1, 1, 2, 0],
61
- "output_base": 16,
69
+ "input": {
70
+ "input_base": 3,
71
+ "digits": [1, 1, 2, 0],
72
+ "output_base": 16
73
+ },
62
74
  "expected": [2, 10]
63
75
  },
64
76
  {
65
77
  "description": "hexadecimal to trinary",
66
78
  "property": "rebase",
67
- "input_base": 16,
68
- "input_digits": [2, 10],
69
- "output_base": 3,
79
+ "input": {
80
+ "input_base": 16,
81
+ "digits": [2, 10],
82
+ "output_base": 3
83
+ },
70
84
  "expected": [1, 1, 2, 0]
71
85
  },
72
86
  {
73
87
  "description": "15-bit integer",
74
88
  "property": "rebase",
75
- "input_base": 97,
76
- "input_digits": [3, 46, 60],
77
- "output_base": 73,
89
+ "input": {
90
+ "input_base": 97,
91
+ "digits": [3, 46, 60],
92
+ "output_base": 73
93
+ },
78
94
  "expected": [6, 10, 45]
79
95
  },
80
96
  {
81
97
  "description": "empty list",
82
98
  "property": "rebase",
83
- "input_base": 2,
84
- "input_digits": [],
85
- "output_base": 10,
99
+ "input": {
100
+ "input_base": 2,
101
+ "digits": [],
102
+ "output_base": 10
103
+ },
86
104
  "expected": [0]
87
105
  },
88
106
  {
89
107
  "description": "single zero",
90
108
  "property": "rebase",
91
- "input_base": 10,
92
- "input_digits": [0],
93
- "output_base": 2,
109
+ "input": {
110
+ "input_base": 10,
111
+ "digits": [0],
112
+ "output_base": 2
113
+ },
94
114
  "expected": [0]
95
115
  },
96
116
  {
97
117
  "description": "multiple zeros",
98
118
  "property": "rebase",
99
- "input_base": 10,
100
- "input_digits": [0, 0, 0],
101
- "output_base": 2,
119
+ "input": {
120
+ "input_base": 10,
121
+ "digits": [0, 0, 0],
122
+ "output_base": 2
123
+ },
102
124
  "expected": [0]
103
125
  },
104
126
  {
105
127
  "description": "leading zeros",
106
128
  "property": "rebase",
107
- "input_base": 7,
108
- "input_digits": [0, 6, 0],
109
- "output_base": 10,
129
+ "input": {
130
+ "input_base": 7,
131
+ "digits": [0, 6, 0],
132
+ "output_base": 10
133
+ },
110
134
  "expected": [4, 2]
111
135
  },
112
136
  {
113
137
  "description": "input base is one",
114
138
  "property": "rebase",
115
- "input_base": 1,
116
- "input_digits": [],
117
- "output_base": 10,
139
+ "input": {
140
+ "input_base": 1,
141
+ "digits": [],
142
+ "output_base": 10
143
+ },
118
144
  "expected": {"error": "input base must be >= 2"}
119
145
  },
120
146
  {
121
147
  "description": "input base is zero",
122
148
  "property": "rebase",
123
- "input_base": 0,
124
- "input_digits": [],
125
- "output_base": 10,
149
+ "input": {
150
+ "input_base": 0,
151
+ "digits": [],
152
+ "output_base": 10
153
+ },
126
154
  "expected": {"error": "input base must be >= 2"}
127
155
  },
128
156
  {
129
157
  "description": "input base is negative",
130
158
  "property": "rebase",
131
- "input_base": -2,
132
- "input_digits": [1],
133
- "output_base": 10,
159
+ "input": {
160
+ "input_base": -2,
161
+ "digits": [1],
162
+ "output_base": 10
163
+ },
134
164
  "expected": {"error": "input base must be >= 2"}
135
165
  },
136
166
  {
137
167
  "description": "negative digit",
138
168
  "property": "rebase",
139
- "input_base": 2,
140
- "input_digits": [1, -1, 1, 0, 1, 0],
141
- "output_base": 10,
169
+ "input": {
170
+ "input_base": 2,
171
+ "digits": [1, -1, 1, 0, 1, 0],
172
+ "output_base": 10
173
+ },
142
174
  "expected": {"error": "all digits must satisfy 0 <= d < input base"}
143
175
  },
144
176
  {
145
177
  "description": "invalid positive digit",
146
178
  "property": "rebase",
147
- "input_base": 2,
148
- "input_digits": [1, 2, 1, 0, 1, 0],
149
- "output_base": 10,
179
+ "input": {
180
+ "input_base": 2,
181
+ "digits": [1, 2, 1, 0, 1, 0],
182
+ "output_base": 10
183
+ },
150
184
  "expected": {"error": "all digits must satisfy 0 <= d < input base"}
151
185
  },
152
186
  {
153
187
  "description": "output base is one",
154
188
  "property": "rebase",
155
- "input_base": 2,
156
- "input_digits": [1, 0, 1, 0, 1, 0],
157
- "output_base": 1,
189
+ "input": {
190
+ "input_base": 2,
191
+ "digits": [1, 0, 1, 0, 1, 0],
192
+ "output_base": 1
193
+ },
158
194
  "expected": {"error": "output base must be >= 2"}
159
195
  },
160
196
  {
161
197
  "description": "output base is zero",
162
198
  "property": "rebase",
163
- "input_base": 10,
164
- "input_digits": [7],
165
- "output_base": 0,
199
+ "input": {
200
+ "input_base": 10,
201
+ "digits": [7],
202
+ "output_base": 0
203
+ },
166
204
  "expected": {"error": "output base must be >= 2"}
167
205
  },
168
206
  {
169
207
  "description": "output base is negative",
170
208
  "property": "rebase",
171
- "input_base": 2,
172
- "input_digits": [1],
173
- "output_base": -7,
209
+ "input": {
210
+ "input_base": 2,
211
+ "digits": [1],
212
+ "output_base": -7
213
+ },
174
214
  "expected": {"error": "output base must be >= 2"}
175
215
  },
176
216
  {
177
217
  "description": "both bases are negative",
178
218
  "property": "rebase",
179
- "input_base": -2,
180
- "input_digits": [1],
181
- "output_base": -7,
219
+ "input": {
220
+ "input_base": -2,
221
+ "digits": [1],
222
+ "output_base": -7
223
+ },
182
224
  "expected": {"error": "input base must be >= 2"}
183
225
  }
184
226
  ]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "exercise": "allergies",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "cases": [
5
5
  {
6
6
  "description": "allergicTo",
@@ -15,7 +15,9 @@
15
15
  {
16
16
  "description": "no allergies means not allergic",
17
17
  "property": "allergicTo",
18
- "score": 0,
18
+ "input": {
19
+ "score": 0
20
+ },
19
21
  "expected": [
20
22
  {
21
23
  "substance": "peanuts",
@@ -34,7 +36,9 @@
34
36
  {
35
37
  "description": "is allergic to eggs",
36
38
  "property": "allergicTo",
37
- "score": 1,
39
+ "input": {
40
+ "score": 1
41
+ },
38
42
  "expected": [
39
43
  {
40
44
  "substance": "eggs",
@@ -45,7 +49,9 @@
45
49
  {
46
50
  "description": "allergic to eggs in addition to other stuff",
47
51
  "property": "allergicTo",
48
- "score": 5,
52
+ "input": {
53
+ "score": 5
54
+ },
49
55
  "expected": [
50
56
  {
51
57
  "substance": "eggs",
@@ -72,43 +78,57 @@
72
78
  {
73
79
  "description": "no allergies at all",
74
80
  "property": "list",
75
- "score": 0,
81
+ "input": {
82
+ "score": 0
83
+ },
76
84
  "expected": []
77
85
  },
78
86
  {
79
87
  "description": "allergic to just eggs",
80
88
  "property": "list",
81
- "score": 1,
89
+ "input": {
90
+ "score": 1
91
+ },
82
92
  "expected": ["eggs"]
83
93
  },
84
94
  {
85
95
  "description": "allergic to just peanuts",
86
96
  "property": "list",
87
- "score": 2,
97
+ "input": {
98
+ "score": 2
99
+ },
88
100
  "expected": ["peanuts"]
89
101
  },
90
102
  {
91
103
  "description": "allergic to just strawberries",
92
104
  "property": "list",
93
- "score": 8,
105
+ "input": {
106
+ "score": 8
107
+ },
94
108
  "expected": ["strawberries"]
95
109
  },
96
110
  {
97
111
  "description": "allergic to eggs and peanuts",
98
112
  "property": "list",
99
- "score": 3,
113
+ "input": {
114
+ "score": 3
115
+ },
100
116
  "expected": ["eggs", "peanuts"]
101
117
  },
102
118
  {
103
119
  "description": "allergic to more than eggs but not peanuts",
104
120
  "property": "list",
105
- "score": 5,
121
+ "input": {
122
+ "score": 5
123
+ },
106
124
  "expected": ["eggs", "shellfish"]
107
125
  },
108
126
  {
109
127
  "description": "allergic to lots of stuff",
110
128
  "property": "list",
111
- "score": 248,
129
+ "input": {
130
+ "score": 248
131
+ },
112
132
  "expected": [ "strawberries",
113
133
  "tomatoes",
114
134
  "chocolate",
@@ -119,7 +139,9 @@
119
139
  {
120
140
  "description": "allergic to everything",
121
141
  "property": "list",
122
- "score": 255,
142
+ "input": {
143
+ "score": 255
144
+ },
123
145
  "expected": [ "eggs",
124
146
  "peanuts",
125
147
  "shellfish",
@@ -133,7 +155,9 @@
133
155
  {
134
156
  "description": "ignore non allergen score parts",
135
157
  "property": "list",
136
- "score": 509,
158
+ "input": {
159
+ "score": 509
160
+ },
137
161
  "expected": [ "eggs",
138
162
  "shellfish",
139
163
  "strawberries",