trackler 2.2.1.62 → 2.2.1.63

Sign up to get free protection for your applications and to get access to all the features.
Files changed (247) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/exercises/all-your-base/canonical-data.json +20 -29
  4. data/problem-specifications/exercises/forth/canonical-data.json +52 -5
  5. data/problem-specifications/exercises/isbn-verifier/canonical-data.json +15 -15
  6. data/problem-specifications/exercises/protein-translation/canonical-data.json +153 -0
  7. data/problem-specifications/exercises/reverse-string/canonical-data.json +39 -0
  8. data/problem-specifications/exercises/reverse-string/description.md +5 -0
  9. data/problem-specifications/exercises/reverse-string/metadata.yml +5 -0
  10. data/tracks/c/config.json +42 -41
  11. data/tracks/csharp/config.json +13 -0
  12. data/tracks/csharp/exercises/Exercises.sln +6 -0
  13. data/tracks/csharp/exercises/isbn-verifier/Example.cs +27 -0
  14. data/tracks/csharp/exercises/isbn-verifier/IsbnVerifier.cs +9 -0
  15. data/tracks/csharp/exercises/isbn-verifier/IsbnVerifier.csproj +19 -0
  16. data/tracks/csharp/exercises/isbn-verifier/IsbnVerifierTest.cs +84 -0
  17. data/tracks/csharp/exercises/isbn-verifier/README.md +40 -0
  18. data/tracks/csharp/generators/Exercises/IsbnVerifier.cs +15 -0
  19. data/tracks/delphi/config.json +28 -28
  20. data/tracks/erlang/config.json +10 -0
  21. data/tracks/erlang/exercises/accumulate/rebar.config +1 -1
  22. data/tracks/erlang/exercises/accumulate/test/accumulate_tests.erl +9 -7
  23. data/tracks/erlang/exercises/all-your-base/rebar.config +1 -1
  24. data/tracks/erlang/exercises/all-your-base/test/all_your_base_tests.erl +26 -24
  25. data/tracks/erlang/exercises/allergies/rebar.config +1 -1
  26. data/tracks/erlang/exercises/allergies/test/allergies_tests.erl +19 -17
  27. data/tracks/erlang/exercises/anagram/rebar.config +1 -3
  28. data/tracks/erlang/exercises/anagram/test/anagram_tests.erl +14 -12
  29. data/tracks/erlang/exercises/atbash-cipher/rebar.config +1 -1
  30. data/tracks/erlang/exercises/atbash-cipher/test/atbash_cipher_tests.erl +7 -5
  31. data/tracks/erlang/exercises/bank-account/rebar.config +1 -1
  32. data/tracks/erlang/exercises/bank-account/test/bank_account_tests.erl +52 -51
  33. data/tracks/erlang/exercises/beer-song/rebar.config +30 -0
  34. data/tracks/erlang/exercises/beer-song/test/beer_song_tests.erl +11 -10
  35. data/tracks/erlang/exercises/bob/rebar.config +1 -1
  36. data/tracks/erlang/exercises/bob/test/bob_tests.erl +33 -35
  37. data/tracks/erlang/exercises/circular-buffer/rebar.config +1 -1
  38. data/tracks/erlang/exercises/circular-buffer/test/circular_buffer_tests.erl +33 -32
  39. data/tracks/erlang/exercises/clock/rebar.config +1 -1
  40. data/tracks/erlang/exercises/clock/test/clock_tests.erl +57 -50
  41. data/tracks/erlang/exercises/collatz-conjecture/rebar.config +1 -1
  42. data/tracks/erlang/exercises/collatz-conjecture/test/collatz_conjecture_tests.erl +11 -9
  43. data/tracks/erlang/exercises/complex-numbers/rebar.config +1 -1
  44. data/tracks/erlang/exercises/complex-numbers/test/complex_numbers_tests.erl +102 -76
  45. data/tracks/erlang/exercises/custom-set/rebar.config +1 -1
  46. data/tracks/erlang/exercises/custom-set/test/custom_set_tests.erl +100 -109
  47. data/tracks/erlang/exercises/difference-of-squares/rebar.config +1 -1
  48. data/tracks/erlang/exercises/difference-of-squares/test/difference_of_squares_tests.erl +8 -7
  49. data/tracks/erlang/exercises/etl/rebar.config +1 -1
  50. data/tracks/erlang/exercises/etl/test/etl_tests.erl +6 -5
  51. data/tracks/erlang/exercises/gigasecond/rebar.config +1 -1
  52. data/tracks/erlang/exercises/gigasecond/test/gigasecond_tests.erl +9 -8
  53. data/tracks/erlang/exercises/grade-school/rebar.config +1 -1
  54. data/tracks/erlang/exercises/grade-school/test/grade_school_tests.erl +27 -23
  55. data/tracks/erlang/exercises/grains/rebar.config +1 -1
  56. data/tracks/erlang/exercises/grains/test/grains_tests.erl +7 -6
  57. data/tracks/erlang/exercises/hamming/rebar.config +1 -1
  58. data/tracks/erlang/exercises/hamming/test/hamming_tests.erl +20 -23
  59. data/tracks/erlang/exercises/hello-world/rebar.config +1 -1
  60. data/tracks/erlang/exercises/hello-world/test/hello_world_tests.erl +6 -4
  61. data/tracks/erlang/exercises/isogram/rebar.config +1 -1
  62. data/tracks/erlang/exercises/isogram/test/isogram_tests.erl +14 -12
  63. data/tracks/erlang/exercises/largest-series-product/rebar.config +1 -1
  64. data/tracks/erlang/exercises/largest-series-product/test/largest_series_product_tests.erl +22 -21
  65. data/tracks/erlang/exercises/leap/rebar.config +1 -1
  66. data/tracks/erlang/exercises/leap/test/leap_tests.erl +8 -7
  67. data/tracks/erlang/exercises/luhn/rebar.config +1 -1
  68. data/tracks/erlang/exercises/luhn/test/luhn_tests.erl +18 -16
  69. data/tracks/erlang/exercises/meetup/rebar.config +1 -1
  70. data/tracks/erlang/exercises/meetup/test/meetup_tests.erl +96 -95
  71. data/tracks/erlang/exercises/nucleotide-count/rebar.config +1 -1
  72. data/tracks/erlang/exercises/nucleotide-count/test/nucleotide_count_tests.erl +12 -11
  73. data/tracks/erlang/exercises/pangram/README.md +60 -0
  74. data/tracks/erlang/exercises/{accumulate → pangram}/include/exercism.hrl +0 -0
  75. data/tracks/erlang/exercises/{beer-song/rebar.conf → pangram/rebar.config} +0 -0
  76. data/tracks/erlang/exercises/pangram/src/example.erl +11 -0
  77. data/tracks/erlang/exercises/pangram/src/pangram.app.src +9 -0
  78. data/tracks/erlang/exercises/pangram/src/pangram.erl +8 -0
  79. data/tracks/erlang/exercises/pangram/test/pangram_tests.erl +38 -0
  80. data/tracks/erlang/exercises/parallel-letter-frequency/rebar.config +1 -1
  81. data/tracks/erlang/exercises/parallel-letter-frequency/test/parallel_letter_frequency_tests.erl +7 -6
  82. data/tracks/erlang/exercises/phone-number/rebar.config +1 -1
  83. data/tracks/erlang/exercises/phone-number/test/phone_number_tests.erl +13 -12
  84. data/tracks/erlang/exercises/rna-transcription/rebar.config +1 -1
  85. data/tracks/erlang/exercises/rna-transcription/test/rna_transcription_tests.erl +13 -11
  86. data/tracks/erlang/exercises/robot-simulator/rebar.config +1 -1
  87. data/tracks/erlang/exercises/robot-simulator/test/robot_simulator_tests.erl +70 -69
  88. data/tracks/erlang/exercises/roman-numerals/rebar.config +1 -1
  89. data/tracks/erlang/exercises/roman-numerals/test/roman_numerals_tests.erl +6 -5
  90. data/tracks/erlang/exercises/rotational-cipher/rebar.config +1 -8
  91. data/tracks/erlang/exercises/rotational-cipher/test/rotational_cipher_tests.erl +29 -27
  92. data/tracks/erlang/exercises/scrabble-score/rebar.config +1 -1
  93. data/tracks/erlang/exercises/scrabble-score/test/scrabble_score_tests.erl +6 -5
  94. data/tracks/erlang/exercises/series/rebar.config +1 -1
  95. data/tracks/erlang/exercises/series/test/series_tests.erl +6 -5
  96. data/tracks/erlang/exercises/sieve/rebar.config +1 -1
  97. data/tracks/erlang/exercises/sieve/test/sieve_tests.erl +10 -8
  98. data/tracks/erlang/exercises/space-age/rebar.config +1 -1
  99. data/tracks/erlang/exercises/space-age/test/space_age_tests.erl +20 -19
  100. data/tracks/erlang/exercises/spiral-matrix/rebar.config +1 -1
  101. data/tracks/erlang/exercises/spiral-matrix/test/spiral_matrix_tests.erl +12 -10
  102. data/tracks/erlang/exercises/strain/rebar.config +1 -1
  103. data/tracks/erlang/exercises/strain/test/strain_tests.erl +17 -16
  104. data/tracks/erlang/exercises/sum-of-multiples/rebar.config +1 -1
  105. data/tracks/erlang/exercises/sum-of-multiples/test/sum_of_multiples_tests.erl +16 -15
  106. data/tracks/erlang/exercises/triangle/rebar.config +1 -1
  107. data/tracks/erlang/exercises/triangle/test/triangle_tests.erl +20 -19
  108. data/tracks/erlang/exercises/two-fer/rebar.config +1 -1
  109. data/tracks/erlang/exercises/two-fer/test/two_fer_tests.erl +8 -7
  110. data/tracks/erlang/exercises/word-count/rebar.config +1 -1
  111. data/tracks/erlang/exercises/word-count/test/word_count_tests.erl +6 -5
  112. data/tracks/erlang/exercises/zipper/rebar.config +1 -1
  113. data/tracks/erlang/exercises/zipper/test/zipper_tests.erl +47 -46
  114. data/tracks/erlang/testgen/src/tgen.erl +8 -6
  115. data/tracks/erlang/testgen/src/tgen_bob.erl +1 -1
  116. data/tracks/erlang/testgen/src/tgen_collatz-conjecture.erl +2 -2
  117. data/tracks/erlang/testgen/src/tgen_complex-numbers.erl +11 -11
  118. data/tracks/erlang/testgen/src/tgen_custom-set.erl +14 -14
  119. data/tracks/erlang/testgen/src/tgen_hamming.erl +2 -2
  120. data/tracks/erlang/testgen/src/tgen_hello-world.erl +1 -1
  121. data/tracks/erlang/testgen/src/tgen_leap.erl +1 -1
  122. data/tracks/erlang/testgen/src/tgen_rna-transcription.erl +2 -2
  123. data/tracks/erlang/testgen/src/tgs.erl +6 -0
  124. data/tracks/fsharp/exercises/beer-song/BeerSong.fs +1 -5
  125. data/tracks/fsharp/exercises/beer-song/BeerSongTest.fs +342 -20
  126. data/tracks/fsharp/exercises/beer-song/Example.fs +16 -10
  127. data/tracks/fsharp/exercises/food-chain/Example.fs +1 -1
  128. data/tracks/fsharp/exercises/food-chain/FoodChain.fs +1 -3
  129. data/tracks/fsharp/exercises/food-chain/FoodChainTest.fs +11 -11
  130. data/tracks/fsharp/exercises/house/Example.fs +1 -1
  131. data/tracks/fsharp/exercises/house/House.fs +1 -3
  132. data/tracks/fsharp/exercises/house/HouseTest.fs +202 -202
  133. data/tracks/fsharp/exercises/proverb/Example.fs +9 -9
  134. data/tracks/fsharp/exercises/proverb/Proverb.fs +1 -3
  135. data/tracks/fsharp/exercises/proverb/ProverbTest.fs +50 -21
  136. data/tracks/fsharp/exercises/twelve-days/Example.fs +4 -4
  137. data/tracks/fsharp/exercises/twelve-days/TwelveDays.fs +2 -6
  138. data/tracks/fsharp/exercises/twelve-days/TwelveDaysTest.fs +81 -57
  139. data/tracks/fsharp/generators/Generators.fs +39 -15
  140. data/tracks/go/bin/run-generators +5 -1
  141. data/tracks/go/config.json +14 -2
  142. data/tracks/go/exercises/accumulate/example.go +2 -1
  143. data/tracks/go/exercises/zebra-puzzle/.meta/hints.md +24 -0
  144. data/tracks/go/exercises/zebra-puzzle/README.md +76 -0
  145. data/tracks/go/exercises/zebra-puzzle/example.go +256 -0
  146. data/tracks/go/exercises/zebra-puzzle/zebra_puzzle_test.go +18 -0
  147. data/tracks/haskell/exercises/forth/package.yaml +1 -1
  148. data/tracks/haskell/exercises/forth/test/Tests.hs +1 -4
  149. data/tracks/haskell/exercises/pascals-triangle/package.yaml +1 -1
  150. data/tracks/haskell/exercises/pascals-triangle/test/Tests.hs +22 -1
  151. data/tracks/java/POLICIES.md +3 -3
  152. data/tracks/java/config.json +21 -2
  153. data/tracks/java/exercises/atbash-cipher/.meta/src/reference/java/Atbash.java +12 -12
  154. data/tracks/java/exercises/protein-translation/.meta/src/reference/java/ProteinTranslator.java +47 -0
  155. data/tracks/java/exercises/protein-translation/.meta/version +1 -0
  156. data/tracks/java/exercises/protein-translation/README.md +58 -0
  157. data/tracks/java/exercises/protein-translation/build.gradle +18 -0
  158. data/tracks/java/exercises/protein-translation/src/main/java/ProteinTranslator.java +8 -0
  159. data/tracks/java/exercises/protein-translation/src/test/java/ProteinTranslatorTest.java +179 -0
  160. data/tracks/java/exercises/settings.gradle +1 -0
  161. data/tracks/javascript/.eslintignore +2 -2
  162. data/tracks/javascript/exercises/accumulate/example.js +1 -2
  163. data/tracks/javascript/exercises/grains/example.js +6 -3
  164. data/tracks/kotlin/exercises/beer-song/.meta/src/reference/kotlin/BeerSong.kt +3 -3
  165. data/tracks/kotlin/exercises/beer-song/.meta/version +1 -1
  166. data/tracks/kotlin/exercises/beer-song/README.md +1 -1
  167. data/tracks/kotlin/exercises/beer-song/src/test/kotlin/BeerSongTest.kt +6 -6
  168. data/tracks/kotlin/exercises/forth/.meta/version +1 -1
  169. data/tracks/kotlin/exercises/forth/src/test/kotlin/ForthEvaluatorTest.kt +0 -7
  170. data/tracks/kotlin/exercises/meetup/README.md +16 -12
  171. data/tracks/kotlin/exercises/nth-prime/.meta/src/reference/kotlin/Prime.kt +7 -2
  172. data/tracks/kotlin/exercises/nth-prime/.meta/version +1 -1
  173. data/tracks/kotlin/exercises/nth-prime/src/test/kotlin/PrimeTest.kt +10 -1
  174. data/tracks/kotlin/exercises/nucleotide-count/README.md +2 -2
  175. data/tracks/kotlin/exercises/pascals-triangle/.meta/src/reference/kotlin/PascalsTriangle.kt +1 -1
  176. data/tracks/kotlin/exercises/pascals-triangle/.meta/version +1 -1
  177. data/tracks/kotlin/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt +58 -1
  178. data/tracks/kotlin/exercises/sum-of-multiples/README.md +3 -3
  179. data/tracks/ocaml/exercises/forth/test.ml +1 -3
  180. data/tracks/ocaml/exercises/rectangles/example.ml +11 -11
  181. data/tracks/php/exercises/bob/example.php +2 -2
  182. data/tracks/purescript/config.json +3 -3
  183. data/tracks/python/config.json +34 -22
  184. data/tracks/python/exercises/alphametics/example.py +90 -34
  185. data/tracks/python/exercises/ocr-numbers/example.py +18 -21
  186. data/tracks/python/exercises/ocr-numbers/ocr_numbers.py +1 -5
  187. data/tracks/python/exercises/ocr-numbers/ocr_numbers_test.py +124 -106
  188. data/tracks/python/exercises/simple-linked-list/README.md +49 -0
  189. data/tracks/python/exercises/simple-linked-list/example.py +67 -0
  190. data/tracks/python/exercises/simple-linked-list/hints.md +10 -0
  191. data/tracks/python/exercises/simple-linked-list/simple_linked_list.py +33 -0
  192. data/tracks/python/exercises/simple-linked-list/simple_linked_list_test.py +112 -0
  193. data/tracks/rust/README.md +2 -0
  194. data/tracks/rust/bin/init_exercise.py +586 -0
  195. data/tracks/rust/config.json +20 -10
  196. data/tracks/rust/exercises/book-store/.gitignore +3 -0
  197. data/tracks/rust/exercises/book-store/Cargo-example.toml +7 -0
  198. data/tracks/rust/exercises/book-store/Cargo.toml +6 -0
  199. data/tracks/rust/exercises/book-store/README.md +107 -0
  200. data/tracks/rust/exercises/book-store/example.rs +187 -0
  201. data/tracks/rust/exercises/book-store/src/lib.rs +3 -0
  202. data/tracks/rust/exercises/book-store/tests/book-store.rs +130 -0
  203. data/tracks/sml/config.json +8 -8
  204. data/tracks/typescript/config.json +6 -6
  205. metadata +43 -46
  206. data/tracks/erlang/exercises/all-your-base/include/exercism.hrl +0 -11
  207. data/tracks/erlang/exercises/allergies/include/exercism.hrl +0 -11
  208. data/tracks/erlang/exercises/anagram/include/exercism.hrl +0 -11
  209. data/tracks/erlang/exercises/atbash-cipher/include/exercism.hrl +0 -11
  210. data/tracks/erlang/exercises/bank-account/include/exercism.hrl +0 -11
  211. data/tracks/erlang/exercises/beer-song/include/exercism.hrl +0 -11
  212. data/tracks/erlang/exercises/bob/include/exercism.hrl +0 -11
  213. data/tracks/erlang/exercises/circular-buffer/include/exercism.hrl +0 -11
  214. data/tracks/erlang/exercises/clock/include/exercism.hrl +0 -11
  215. data/tracks/erlang/exercises/collatz-conjecture/include/exercism.hrl +0 -11
  216. data/tracks/erlang/exercises/complex-numbers/include/exercism.hrl +0 -11
  217. data/tracks/erlang/exercises/custom-set/include/exercism.hrl +0 -11
  218. data/tracks/erlang/exercises/difference-of-squares/include/exercism.hrl +0 -11
  219. data/tracks/erlang/exercises/etl/include/exercism.hrl +0 -11
  220. data/tracks/erlang/exercises/gigasecond/include/exercism.hrl +0 -11
  221. data/tracks/erlang/exercises/grade-school/include/exercism.hrl +0 -11
  222. data/tracks/erlang/exercises/grains/include/exercism.hrl +0 -11
  223. data/tracks/erlang/exercises/hamming/include/exercism.hrl +0 -11
  224. data/tracks/erlang/exercises/hello-world/include/exercism.hrl +0 -11
  225. data/tracks/erlang/exercises/isogram/include/exercism.hrl +0 -11
  226. data/tracks/erlang/exercises/largest-series-product/include/exercism.hrl +0 -11
  227. data/tracks/erlang/exercises/leap/include/exercism.hrl +0 -11
  228. data/tracks/erlang/exercises/luhn/include/exercism.hrl +0 -11
  229. data/tracks/erlang/exercises/meetup/include/exercism.hrl +0 -11
  230. data/tracks/erlang/exercises/nucleotide-count/include/exercism.hrl +0 -11
  231. data/tracks/erlang/exercises/parallel-letter-frequency/include/exercism.hrl +0 -11
  232. data/tracks/erlang/exercises/phone-number/include/exercism.hrl +0 -11
  233. data/tracks/erlang/exercises/rna-transcription/include/exercism.hrl +0 -11
  234. data/tracks/erlang/exercises/robot-simulator/include/exercism.hrl +0 -11
  235. data/tracks/erlang/exercises/roman-numerals/include/exercism.hrl +0 -11
  236. data/tracks/erlang/exercises/rotational-cipher/include/exercism.hrl +0 -11
  237. data/tracks/erlang/exercises/scrabble-score/include/exercism.hrl +0 -11
  238. data/tracks/erlang/exercises/series/include/exercism.hrl +0 -11
  239. data/tracks/erlang/exercises/sieve/include/exercism.hrl +0 -11
  240. data/tracks/erlang/exercises/space-age/include/exercism.hrl +0 -11
  241. data/tracks/erlang/exercises/spiral-matrix/include/exercism.hrl +0 -11
  242. data/tracks/erlang/exercises/strain/include/exercism.hrl +0 -11
  243. data/tracks/erlang/exercises/sum-of-multiples/include/exercism.hrl +0 -11
  244. data/tracks/erlang/exercises/triangle/include/exercism.hrl +0 -11
  245. data/tracks/erlang/exercises/two-fer/include/exercism.hrl +0 -11
  246. data/tracks/erlang/exercises/word-count/include/exercism.hrl +0 -11
  247. data/tracks/erlang/exercises/zipper/include/exercism.hrl +0 -11
data/tracks/c/config.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "optional_values",
11
11
  "text_formatting"
12
12
  ],
13
- "uuid": "a0278e53-728d-4c04-9a0e-d6f7fe7ce98f"
13
+ "uuid": "adf43ee2-0730-7980-b2d9-931c91510d78a9dbd19"
14
14
  },
15
15
  {
16
16
  "core": true,
@@ -22,7 +22,7 @@
22
22
  "control_flow_loops",
23
23
  "strings"
24
24
  ],
25
- "uuid": "7167e43c-04bd-4c6c-a446-a37384d42626"
25
+ "uuid": "c0bf4029-06d6-db80-4447-464a1248f1ed63b8964"
26
26
  },
27
27
  {
28
28
  "core": false,
@@ -33,7 +33,7 @@
33
33
  "logic"
34
34
  ],
35
35
  "unlocked_by": null,
36
- "uuid": "24721f7a-4123-470f-81e2-a252e56f3ceb"
36
+ "uuid": "7162e083-0d6a-a680-90c6-86d52b661d6f291a710"
37
37
  },
38
38
  {
39
39
  "core": true,
@@ -42,7 +42,7 @@
42
42
  "topics": [
43
43
  "dates"
44
44
  ],
45
- "uuid": "532393f6-dedc-40fc-872e-b265450fd007"
45
+ "uuid": "aeae2227-05e8-6a80-b0ab-721699f2d2f16fec278"
46
46
  },
47
47
  {
48
48
  "core": true,
@@ -53,7 +53,7 @@
53
53
  "control_flow_loops",
54
54
  "strings"
55
55
  ],
56
- "uuid": "500c2f8c-7404-47e7-8064-8c426b0632ea"
56
+ "uuid": "923e4a3d-0a32-c780-4bdf-85f0dbd56599aca7a4a"
57
57
  },
58
58
  {
59
59
  "core": false,
@@ -64,7 +64,7 @@
64
64
  "strings"
65
65
  ],
66
66
  "unlocked_by": null,
67
- "uuid": "b69b0f46-644c-4e98-8e31-34e392477f57"
67
+ "uuid": "4600d7bd-01c4-fc80-e5e2-fa88943adbbabf3f507"
68
68
  },
69
69
  {
70
70
  "core": false,
@@ -75,7 +75,7 @@
75
75
  "strings"
76
76
  ],
77
77
  "unlocked_by": "beer-song",
78
- "uuid": "a559ee05-0ce8-4071-a159-b7a54ef3215c"
78
+ "uuid": "2e673094-09b8-7f80-7b77-cbcca40ad40f414229e"
79
79
  },
80
80
  {
81
81
  "core": false,
@@ -87,7 +87,7 @@
87
87
  "strings"
88
88
  ],
89
89
  "unlocked_by": "isogram",
90
- "uuid": "08904f5e-3b07-4f0b-9dc6-6e371df1ef02"
90
+ "uuid": "17fc50f8-07fa-1380-522c-73ebb21f77f3332879f"
91
91
  },
92
92
  {
93
93
  "core": true,
@@ -98,7 +98,7 @@
98
98
  "control_flow_loops",
99
99
  "performance_optimizations"
100
100
  ],
101
- "uuid": "f9b3b7f1-c49a-421b-a38d-b740f1910ca5"
101
+ "uuid": "b2862cca-043f-d280-baf7-1d776d48ef98f2c4f2d"
102
102
  },
103
103
  {
104
104
  "core": false,
@@ -110,7 +110,7 @@
110
110
  "strings"
111
111
  ],
112
112
  "unlocked_by": "palindrome-products",
113
- "uuid": "d64646d1-5af9-4bdc-b637-5c56447e6693"
113
+ "uuid": "baa90d2c-0059-eb80-7e4a-2230bd8020f195287dd"
114
114
  },
115
115
  {
116
116
  "core": false,
@@ -122,7 +122,7 @@
122
122
  "strings"
123
123
  ],
124
124
  "unlocked_by": "isogram",
125
- "uuid": "70c0e2d6-70a4-499f-86e3-6e209b494a5d"
125
+ "uuid": "889a27d6-0d85-a180-02ee-06b8f0171314ae515fe"
126
126
  },
127
127
  {
128
128
  "core": false,
@@ -134,7 +134,7 @@
134
134
  "control_flow_loops"
135
135
  ],
136
136
  "unlocked_by": "binary",
137
- "uuid": "1b3144fe-8e9f-46bc-9206-74cad1c5b088"
137
+ "uuid": "799f8e58-07e4-cc80-2287-93d97469a5787d3628d"
138
138
  },
139
139
  {
140
140
  "core": false,
@@ -146,7 +146,7 @@
146
146
  "performance_optimizations"
147
147
  ],
148
148
  "unlocked_by": "sieve",
149
- "uuid": "5f88968b-7c02-4846-9f38-cec55d19df66"
149
+ "uuid": "b4282a1b-0696-7a80-c709-a716f93e99e8f247e8c"
150
150
  },
151
151
  {
152
152
  "core": true,
@@ -157,7 +157,7 @@
157
157
  "control_flow_loops",
158
158
  "strings"
159
159
  ],
160
- "uuid": "5d988d28-2ef7-46e7-b706-011cc5ecb6fc"
160
+ "uuid": "08c946d6-0f47-1580-ab77-2dab7f147248642763b"
161
161
  },
162
162
  {
163
163
  "core": false,
@@ -169,7 +169,7 @@
169
169
  "strings"
170
170
  ],
171
171
  "unlocked_by": "hamming",
172
- "uuid": "47308cfb-357a-4d61-852f-49b26ee2b236"
172
+ "uuid": "09954333-0440-4380-77fd-1c7deeb962b09ed044b"
173
173
  },
174
174
  {
175
175
  "core": true,
@@ -178,7 +178,7 @@
178
178
  "topics": [
179
179
  "control_flow_loops"
180
180
  ],
181
- "uuid": "3531b23c-7a23-47b7-88f4-ff8519d0392b"
181
+ "uuid": "d33bc183-0fee-a380-a3ae-26af7404a8e977f9bb1"
182
182
  },
183
183
  {
184
184
  "core": false,
@@ -189,7 +189,7 @@
189
189
  "control_flow_loops"
190
190
  ],
191
191
  "unlocked_by": "difference-of-squares",
192
- "uuid": "a9d8772f-3733-4b84-b8c6-f3c38a8ce5db"
192
+ "uuid": "550dd755-05e3-2680-ac48-a4749bf974284824573"
193
193
  },
194
194
  {
195
195
  "core": true,
@@ -201,7 +201,7 @@
201
201
  "control_flow_loops",
202
202
  "searching"
203
203
  ],
204
- "uuid": "23231bc9-4a75-40ab-b934-f8b429b55224"
204
+ "uuid": "bea04407-0db4-7380-19da-7afcb44af567ef49d7f"
205
205
  },
206
206
  {
207
207
  "core": true,
@@ -214,7 +214,7 @@
214
214
  "strings",
215
215
  "structs"
216
216
  ],
217
- "uuid": "db544fba-acf4-47b5-b86c-fc9f0680517d"
217
+ "uuid": "c8e58b48-09fe-c480-a7ed-e9e96785669b67d21be"
218
218
  },
219
219
  {
220
220
  "core": false,
@@ -227,7 +227,7 @@
227
227
  "structs"
228
228
  ],
229
229
  "unlocked_by": "isogram",
230
- "uuid": "2e2d009b-3bd6-4258-988b-5e36e2e27f3c"
230
+ "uuid": "939713ed-0688-e280-16ca-dca4ff64203ff19b557"
231
231
  },
232
232
  {
233
233
  "core": true,
@@ -239,7 +239,7 @@
239
239
  "memory_management",
240
240
  "structs"
241
241
  ],
242
- "uuid": "28bdb8bb-26cd-40c1-91ba-a00fda09eaf2"
242
+ "uuid": "0eab95ef-01fd-3980-afb8-6c697a45b1e5cabbd56"
243
243
  },
244
244
  {
245
245
  "core": false,
@@ -251,7 +251,7 @@
251
251
  "structs"
252
252
  ],
253
253
  "unlocked_by": "acronym",
254
- "uuid": "82b19968-03f9-4e17-b729-db6c3e2abfa4"
254
+ "uuid": "e2e71dc6-0b26-6e80-1b32-d81f9902267e0b6e2f9"
255
255
  },
256
256
  {
257
257
  "core": true,
@@ -262,7 +262,7 @@
262
262
  "control_flow_loops",
263
263
  "strings"
264
264
  ],
265
- "uuid": "e39c4445-eadd-4bcf-9b49-2256ed38d6fd"
265
+ "uuid": "c5e26dcf-09f6-9180-d2b3-5abb64d6d2127113203"
266
266
  },
267
267
  {
268
268
  "core": true,
@@ -274,7 +274,7 @@
274
274
  "memory_management",
275
275
  "strings"
276
276
  ],
277
- "uuid": "92e18b2f-f137-452e-a21d-045874da84d7"
277
+ "uuid": "a67b5575-0f15-7180-71cd-b50c96135cd5683fc78"
278
278
  },
279
279
  {
280
280
  "core": true,
@@ -286,7 +286,7 @@
286
286
  "strings",
287
287
  "text_formatting"
288
288
  ],
289
- "uuid": "3b3d1f61-c580-4a37-9cab-449eeebe7f86"
289
+ "uuid": "bf4fd059-075f-f080-73db-9789b53ed5e3735291c"
290
290
  },
291
291
  {
292
292
  "core": true,
@@ -296,7 +296,7 @@
296
296
  "control_flow_if_statements",
297
297
  "memory_management"
298
298
  ],
299
- "uuid": "f1b60913-78d3-4872-a1a3-5ac3930c74ff"
299
+ "uuid": "31bb7803-0b95-6d80-5fd8-94bb22d56f8c26c5fa3"
300
300
  },
301
301
  {
302
302
  "core": false,
@@ -309,7 +309,7 @@
309
309
  "text_formatting"
310
310
  ],
311
311
  "unlocked_by": "atbash-cipher",
312
- "uuid": "75b292a3-2a94-40f9-8798-608812a6c0f8"
312
+ "uuid": "19b9e775-00d0-2780-1f3d-f25e276f6ed5434bf2a"
313
313
  },
314
314
  {
315
315
  "core": false,
@@ -323,7 +323,7 @@
323
323
  "time_functions"
324
324
  ],
325
325
  "unlocked_by": "gigasecond",
326
- "uuid": "5c782b4f-862e-4feb-98d6-a0eaf9d43a74"
326
+ "uuid": "5d00eb2b-054e-8180-6049-aa59d575549c59015ab"
327
327
  },
328
328
  {
329
329
  "core": false,
@@ -336,7 +336,7 @@
336
336
  "text_formatting"
337
337
  ],
338
338
  "unlocked_by": "hamming",
339
- "uuid": "ca136f47-07fc-4bd5-9b81-a492ac81a7e6"
339
+ "uuid": "2717a3ac-040f-6080-063a-c48b1bd91a3908ea2b9"
340
340
  },
341
341
  {
342
342
  "core": true,
@@ -349,7 +349,7 @@
349
349
  "structs",
350
350
  "variable_argument_lists"
351
351
  ],
352
- "uuid": "87c36588-5917-4790-9566-f7bc21bf41c4"
352
+ "uuid": "25c63d52-0512-9880-4ce4-f89464e0eb9adef46ac"
353
353
  },
354
354
  {
355
355
  "core": false,
@@ -362,7 +362,7 @@
362
362
  "structs"
363
363
  ],
364
364
  "unlocked_by": "pascals-triangle",
365
- "uuid": "4b30bb00-c559-423c-ae1c-9c5eaf9cb1c8"
365
+ "uuid": "7bec037f-0c1a-e280-6464-d88928ff4e9ea201f6b"
366
366
  },
367
367
  {
368
368
  "core": true,
@@ -373,7 +373,7 @@
373
373
  "mathematics",
374
374
  "memory_management"
375
375
  ],
376
- "uuid": "3ebdb4e4-5e35-48f0-a572-87c40b51475f"
376
+ "uuid": "fd504736-088f-cb80-47d5-4ae7cefe85236d9b430"
377
377
  },
378
378
  {
379
379
  "core": false,
@@ -384,7 +384,7 @@
384
384
  "mathematics"
385
385
  ],
386
386
  "unlocked_by": "pascals-triangle",
387
- "uuid": "82bb6c43-668a-4563-bc05-056e45cf86a3"
387
+ "uuid": "4a62a85d-0c2c-7b80-662f-43960864d9210d62582"
388
388
  },
389
389
  {
390
390
  "core": true,
@@ -394,7 +394,7 @@
394
394
  "control_flow_if_statements",
395
395
  "control_flow_loops"
396
396
  ],
397
- "uuid": "73e5774c-7d8e-4ed6-9d72-3cb59af441c0"
397
+ "uuid": "6c74d5e3-0c68-e680-4533-fcd65e2cc6eddcbca21"
398
398
  },
399
399
  {
400
400
  "core": true,
@@ -406,7 +406,7 @@
406
406
  "strings",
407
407
  "structs"
408
408
  ],
409
- "uuid": "b1f13fdd-4c78-443a-8e37-6d0a3fafbc15"
409
+ "uuid": "44422bfb-0462-6080-889f-10d6e3a718339a0174b"
410
410
  },
411
411
  {
412
412
  "core": true,
@@ -418,7 +418,7 @@
418
418
  "strings",
419
419
  "structs"
420
420
  ],
421
- "uuid": "2ac990f4-39b0-416e-93ee-217dc0181401"
421
+ "uuid": "f2a2bbaa-05f3-f380-b2f3-a6787a1f0fa67c05888"
422
422
  },
423
423
  {
424
424
  "core": false,
@@ -428,7 +428,7 @@
428
428
  "functions"
429
429
  ],
430
430
  "unlocked_by": "gigasecond",
431
- "uuid": "11a574a6-ffea-4de5-abc1-5566bd200374"
431
+ "uuid": "d3c0a69d-0d08-f980-8d54-30ff7ec0ae6b7b920d5"
432
432
  },
433
433
  {
434
434
  "core": false,
@@ -439,7 +439,7 @@
439
439
  "memory_management"
440
440
  ],
441
441
  "unlocked_by": "atbash-cipher",
442
- "uuid": "55b87cc2-c3a0-438a-b2b6-116ad6356802"
442
+ "uuid": "063b1d80-0ed6-ee80-c931-ac16708d94fd2b5c15b"
443
443
  },
444
444
  {
445
445
  "core": false,
@@ -453,7 +453,7 @@
453
453
  "control_flow_loops"
454
454
  ],
455
455
  "unlocked_by": "palindrome-products",
456
- "uuid": "928e9860-0df9-5180-8529-7024c991b3616adc21a"
456
+ "uuid": "971ab109-03b2-2480-7582-cc081a6f67f7411153f"
457
457
  },
458
458
  {
459
459
  "core": false,
@@ -463,7 +463,8 @@
463
463
  "functions",
464
464
  "mathematics"
465
465
  ],
466
- "uuid": "1f68f837-6432-4f9e-afae-0cb17f8e0153"
466
+ "unlocked_by": "triangle",
467
+ "uuid": "e3ff9d66-06f0-6c80-6514-88c5f80bcbcb8310702"
467
468
  },
468
469
  {
469
470
  "core": true,
@@ -475,7 +476,7 @@
475
476
  "structs",
476
477
  "enums"
477
478
  ],
478
- "uuid": "ae266e01-0e88-6c80-ed67-eada1a30f8b4"
479
+ "uuid": "12e72487-0696-f080-02c1-c4006444b71ea02495c"
479
480
  }
480
481
  ],
481
482
  "foregone": [],
@@ -622,6 +622,19 @@
622
622
  "unlocked_by": "accumulate",
623
623
  "uuid": "d5d48857-5325-45d2-9969-95a0d7bba370"
624
624
  },
625
+ {
626
+ "core": false,
627
+ "difficulty": 4,
628
+ "slug": "isbn-verifier",
629
+ "topics": [
630
+ "conditionals",
631
+ "loops",
632
+ "pattern_matching",
633
+ "strings"
634
+ ],
635
+ "unlocked_by": "bob",
636
+ "uuid": "d714b1e6-48b5-44d6-9661-d0acd3dd657b"
637
+ },
625
638
  {
626
639
  "core": false,
627
640
  "difficulty": 5,
@@ -220,6 +220,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CollatzConjecture", "collat
220
220
  EndProject
221
221
  Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComplexNumbers", "complex-numbers\ComplexNumbers.csproj", "{D0399EAC-5563-4234-9828-0C607BAF7623}"
222
222
  EndProject
223
+ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IsbnVerifier", "isbn-verifier\IsbnVerifier.csproj", "{72432190-8D4D-4E64-B622-F83BE80A3CBB}"
224
+ EndProject
223
225
  Global
224
226
  GlobalSection(SolutionConfigurationPlatforms) = preSolution
225
227
  Debug|Any CPU = Debug|Any CPU
@@ -662,6 +664,10 @@ Global
662
664
  {D0399EAC-5563-4234-9828-0C607BAF7623}.Debug|Any CPU.Build.0 = Debug|Any CPU
663
665
  {D0399EAC-5563-4234-9828-0C607BAF7623}.Release|Any CPU.ActiveCfg = Release|Any CPU
664
666
  {D0399EAC-5563-4234-9828-0C607BAF7623}.Release|Any CPU.Build.0 = Release|Any CPU
667
+ {72432190-8D4D-4E64-B622-F83BE80A3CBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
668
+ {72432190-8D4D-4E64-B622-F83BE80A3CBB}.Debug|Any CPU.Build.0 = Debug|Any CPU
669
+ {72432190-8D4D-4E64-B622-F83BE80A3CBB}.Release|Any CPU.ActiveCfg = Release|Any CPU
670
+ {72432190-8D4D-4E64-B622-F83BE80A3CBB}.Release|Any CPU.Build.0 = Release|Any CPU
665
671
  EndGlobalSection
666
672
  GlobalSection(SolutionProperties) = preSolution
667
673
  HideSolutionNode = FALSE
@@ -0,0 +1,27 @@
1
+ using System;
2
+ using System.Text.RegularExpressions;
3
+
4
+ public static class IsbnVerifier
5
+ {
6
+ public static bool IsValid(string number)
7
+ {
8
+ number = number.Replace("-", "");
9
+
10
+ if (!Regex.IsMatch(number, @"^(\d{9}[\dX])$"))
11
+ {
12
+ return false;
13
+ }
14
+
15
+ var sum = 0;
16
+ var weight = 10;
17
+ var digit = 0;
18
+ for (int i = 0; i < number.Length; i++)
19
+ {
20
+ digit = (number[i] == 'X' && i == 9) ? 10 : (int)Char.GetNumericValue(number[i]);
21
+
22
+ sum += digit * weight;
23
+ weight--;
24
+ }
25
+ return sum % 11 == 0;
26
+ }
27
+ }
@@ -0,0 +1,9 @@
1
+ using System;
2
+
3
+ public static class IsbnVerifier
4
+ {
5
+ public static bool IsValid(string number)
6
+ {
7
+ throw new NotImplementedException("You need to implement this function.");
8
+ }
9
+ }
@@ -0,0 +1,19 @@
1
+ <Project Sdk="Microsoft.NET.Sdk">
2
+
3
+ <PropertyGroup>
4
+ <OutputType>Exe</OutputType>
5
+ <TargetFramework>netcoreapp2.0</TargetFramework>
6
+ </PropertyGroup>
7
+
8
+ <ItemGroup>
9
+ <Compile Remove="Example.cs" />
10
+ </ItemGroup>
11
+
12
+ <ItemGroup>
13
+ <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
14
+ <PackageReference Include="xunit" Version="2.3.1" />
15
+ <PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
16
+ </ItemGroup>
17
+
18
+ </Project>
19
+
@@ -0,0 +1,84 @@
1
+ // This file was auto-generated based on version 1.1.0 of the canonical data.
2
+
3
+ using Xunit;
4
+
5
+ public class IsbnVerifierTest
6
+ {
7
+ [Fact]
8
+ public void Valid_isbn_number()
9
+ {
10
+ Assert.True(IsbnVerifier.IsValid("3-598-21508-8"));
11
+ }
12
+
13
+ [Fact(Skip = "Remove to run test")]
14
+ public void Invalid_isbn_check_digit()
15
+ {
16
+ Assert.False(IsbnVerifier.IsValid("3-598-21508-9"));
17
+ }
18
+
19
+ [Fact(Skip = "Remove to run test")]
20
+ public void Valid_isbn_number_with_a_check_digit_of_10()
21
+ {
22
+ Assert.True(IsbnVerifier.IsValid("3-598-21507-X"));
23
+ }
24
+
25
+ [Fact(Skip = "Remove to run test")]
26
+ public void Check_digit_is_a_character_other_than_x()
27
+ {
28
+ Assert.False(IsbnVerifier.IsValid("3-598-21507-A"));
29
+ }
30
+
31
+ [Fact(Skip = "Remove to run test")]
32
+ public void Invalid_character_in_isbn()
33
+ {
34
+ Assert.False(IsbnVerifier.IsValid("3-598-2K507-0"));
35
+ }
36
+
37
+ [Fact(Skip = "Remove to run test")]
38
+ public void X_is_only_valid_as_a_check_digit()
39
+ {
40
+ Assert.False(IsbnVerifier.IsValid("3-598-2X507-9"));
41
+ }
42
+
43
+ [Fact(Skip = "Remove to run test")]
44
+ public void Valid_isbn_without_separating_dashes()
45
+ {
46
+ Assert.True(IsbnVerifier.IsValid("3598215088"));
47
+ }
48
+
49
+ [Fact(Skip = "Remove to run test")]
50
+ public void Isbn_without_separating_dashes_and_x_as_check_digit()
51
+ {
52
+ Assert.True(IsbnVerifier.IsValid("359821507X"));
53
+ }
54
+
55
+ [Fact(Skip = "Remove to run test")]
56
+ public void Isbn_without_check_digit_and_dashes()
57
+ {
58
+ Assert.False(IsbnVerifier.IsValid("359821507"));
59
+ }
60
+
61
+ [Fact(Skip = "Remove to run test")]
62
+ public void Too_long_isbn_and_no_dashes()
63
+ {
64
+ Assert.False(IsbnVerifier.IsValid("3598215078X"));
65
+ }
66
+
67
+ [Fact(Skip = "Remove to run test")]
68
+ public void Isbn_without_check_digit()
69
+ {
70
+ Assert.False(IsbnVerifier.IsValid("3-598-21507"));
71
+ }
72
+
73
+ [Fact(Skip = "Remove to run test")]
74
+ public void Too_long_isbn()
75
+ {
76
+ Assert.False(IsbnVerifier.IsValid("3-598-21507-XX"));
77
+ }
78
+
79
+ [Fact(Skip = "Remove to run test")]
80
+ public void Check_digit_of_x_should_not_be_used_for_0()
81
+ {
82
+ Assert.False(IsbnVerifier.IsValid("3-598-21515-X"));
83
+ }
84
+ }
@@ -0,0 +1,40 @@
1
+ # ISBN Verifier
2
+
3
+ Check if a given ISBN-10 is valid.
4
+
5
+ ## Functionality
6
+
7
+ Given an unknown string the program should check if the provided string is a valid ISBN-10.
8
+ Putting this into place requires some thinking about preprocessing/parsing of the string prior to calculating the check digit for the ISBN.
9
+
10
+ The program should allow for ISBN-10 without the separating dashes to be verified as well.
11
+
12
+ ## ISBN
13
+
14
+ Let's take a random ISBN-10 number, say `3-598-21508-8` for this.
15
+ The first digit block indicates the group where the ISBN belongs. Groups can consist of shared languages, geographic regions or countries. The leading '3' signals this ISBN is from a german speaking country.
16
+ The following number block is to identify the publisher. Since this is a three digit publisher number there is a 5 digit title number for this book.
17
+ The last digit in the ISBN is the check digit which is used to detect read errors.
18
+
19
+ The first 9 digits in the ISBN have to be between 0 and 9.
20
+ The check digit can additionally be an 'X' to allow 10 to be a valid check digit as well.
21
+
22
+ A valid ISBN-10 is calculated with this formula `(x1 * 10 + x2 * 9 + x3 * 8 + x4 * 7 + x5 * 6 + x6 * 5 + x7 * 4 + x8 * 3 + x9 * 2 + x10 * 1) mod 11 == 0`
23
+ So for our example ISBN this means:
24
+ (3 * 10 + 5 * 9 + 9 * 8 + 8 * 7 + 2 * 6 + 1 * 5 + 5 * 4 + 0 * 3 + 8 * 2 + 8 * 1) mod 11 = 0
25
+
26
+ Which proves that the ISBN is valid.
27
+
28
+ ### Submitting Exercises
29
+
30
+ Note that, when trying to submit an exercise, make sure the exercise file that you're submitting is in the `exercism/csharp/<exerciseName>` directory.
31
+
32
+ For example, if you're submitting `bob.cs` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/csharp/bob/bob.cs`.
33
+
34
+ ## Source
35
+
36
+ Wikipedia [https://en.wikipedia.org/wiki/International_Standard_Book_Number#ISBN-10_check_digit_calculation](https://en.wikipedia.org/wiki/International_Standard_Book_Number#ISBN-10_check_digit_calculation)
37
+
38
+ ## Submitting Incomplete Solutions
39
+
40
+ It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -0,0 +1,15 @@
1
+ using Generators.Input;
2
+
3
+ namespace Generators.Exercises
4
+ {
5
+ public class IsbnVerifier : Exercise
6
+ {
7
+ protected override void UpdateCanonicalData(CanonicalData canonicalData)
8
+ {
9
+ foreach (var canonicalDataCase in canonicalData.Cases)
10
+ {
11
+ canonicalDataCase.Property = "IsValid";
12
+ }
13
+ }
14
+ }
15
+ }