trackler 2.2.1.56 → 2.2.1.57

Sign up to get free protection for your applications and to get access to all the features.
Files changed (340) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/TOPICS.txt +2 -2
  4. data/problem-specifications/exercises/zipper/description.md +1 -1
  5. data/tracks/dart/test/exercises_test.dart +9 -9
  6. data/tracks/delphi/exercises/circular-buffer/uCircularBufferExample.pas +3 -3
  7. data/tracks/delphi/exercises/circular-buffer/uCircularBufferTests.pas +160 -86
  8. data/tracks/delphi/exercises/phone-number/README.md +1 -1
  9. data/tracks/erlang/config.json +10 -0
  10. data/tracks/erlang/exercises/isogram/README.md +65 -0
  11. data/tracks/erlang/exercises/isogram/include/exercism.hrl +11 -0
  12. data/tracks/erlang/exercises/isogram/rebar.config +30 -0
  13. data/tracks/erlang/exercises/isogram/src/example.erl +16 -0
  14. data/tracks/erlang/exercises/isogram/src/isogram.app.src +9 -0
  15. data/tracks/erlang/exercises/isogram/src/isogram.erl +9 -0
  16. data/tracks/erlang/exercises/isogram/test/isogram_tests.erl +32 -0
  17. data/tracks/fsharp/exercises/binary-search/BinarySearch.fs +1 -1
  18. data/tracks/fsharp/exercises/binary-search/BinarySearchTest.fs +58 -30
  19. data/tracks/fsharp/exercises/binary-search/Example.fs +1 -1
  20. data/tracks/fsharp/exercises/poker/Example.fs +23 -20
  21. data/tracks/fsharp/exercises/poker/PokerTest.fs +135 -76
  22. data/tracks/fsharp/generators/Generators.fs +21 -0
  23. data/tracks/go/README.md +0 -15
  24. data/tracks/go/bin/run-generators +11 -0
  25. data/tracks/go/config.json +389 -277
  26. data/tracks/go/config/maintainers.json +2 -2
  27. data/tracks/go/docs/TESTS.md +0 -15
  28. data/tracks/go/exercises/accumulate/accumulate_test.go +0 -8
  29. data/tracks/go/exercises/accumulate/example.go +0 -2
  30. data/tracks/go/exercises/acronym/acronym.go +14 -2
  31. data/tracks/go/exercises/acronym/acronym_test.go +0 -8
  32. data/tracks/go/exercises/acronym/cases_test.go +2 -2
  33. data/tracks/go/exercises/acronym/example.go +0 -2
  34. data/tracks/go/exercises/all-your-base/all_your_base_test.go +0 -8
  35. data/tracks/go/exercises/all-your-base/example.go +0 -2
  36. data/tracks/go/exercises/allergies/allergies_test.go +0 -8
  37. data/tracks/go/exercises/allergies/example.go +0 -2
  38. data/tracks/go/exercises/anagram/.meta/gen.go +55 -0
  39. data/tracks/go/exercises/anagram/anagram_test.go +0 -130
  40. data/tracks/go/exercises/anagram/cases_test.go +164 -0
  41. data/tracks/go/exercises/anagram/example.go +0 -2
  42. data/tracks/go/exercises/atbash-cipher/atbash_cipher_test.go +0 -8
  43. data/tracks/go/exercises/atbash-cipher/cases_test.go +2 -2
  44. data/tracks/go/exercises/atbash-cipher/example.go +0 -2
  45. data/tracks/go/exercises/bank-account/bank_account_test.go +0 -8
  46. data/tracks/go/exercises/bank-account/example.go +0 -2
  47. data/tracks/go/exercises/beer-song/beer_test.go +0 -8
  48. data/tracks/go/exercises/beer-song/example.go +0 -2
  49. data/tracks/go/exercises/binary-search-tree/binary_search_tree_test.go +0 -8
  50. data/tracks/go/exercises/binary-search-tree/example.go +0 -2
  51. data/tracks/go/exercises/binary-search/binary_search_test.go +0 -8
  52. data/tracks/go/exercises/binary-search/example.go +0 -2
  53. data/tracks/go/exercises/binary/binary_test.go +0 -11
  54. data/tracks/go/exercises/binary/example.go +0 -2
  55. data/tracks/go/exercises/bob/bob.go +14 -0
  56. data/tracks/go/exercises/bob/bob_test.go +2 -10
  57. data/tracks/go/exercises/bob/cases_test.go +2 -2
  58. data/tracks/go/exercises/bob/example.go +12 -13
  59. data/tracks/go/exercises/book-store/README.md +92 -0
  60. data/tracks/go/exercises/book-store/book_store_test.go +91 -0
  61. data/tracks/go/exercises/book-store/example.go +52 -0
  62. data/tracks/go/exercises/bowling/bowling_test.go +0 -8
  63. data/tracks/go/exercises/bowling/cases_test.go +2 -2
  64. data/tracks/go/exercises/bowling/example.go +0 -2
  65. data/tracks/go/exercises/bracket-push/bracket_push_test.go +0 -8
  66. data/tracks/go/exercises/bracket-push/cases_test.go +2 -2
  67. data/tracks/go/exercises/bracket-push/example.go +0 -3
  68. data/tracks/go/exercises/change/cases_test.go +10 -3
  69. data/tracks/go/exercises/change/change_test.go +1 -9
  70. data/tracks/go/exercises/change/example.go +0 -2
  71. data/tracks/go/exercises/circular-buffer/circular_buffer_test.go +0 -8
  72. data/tracks/go/exercises/circular-buffer/example.go +0 -2
  73. data/tracks/go/exercises/clock/cases_test.go +2 -2
  74. data/tracks/go/exercises/clock/clock_test.go +2 -9
  75. data/tracks/go/exercises/clock/example.go +0 -2
  76. data/tracks/go/exercises/collatz-conjecture/README.md +51 -0
  77. data/tracks/go/exercises/collatz-conjecture/collatz_conjecture_test.go +77 -0
  78. data/tracks/go/exercises/collatz-conjecture/example.go +24 -0
  79. data/tracks/go/exercises/connect/cases_test.go +2 -2
  80. data/tracks/go/exercises/connect/connect_test.go +0 -8
  81. data/tracks/go/exercises/connect/example.go +0 -2
  82. data/tracks/go/exercises/crypto-square/crypto_square_test.go +0 -8
  83. data/tracks/go/exercises/crypto-square/example.go +0 -2
  84. data/tracks/go/exercises/custom-set/cases_test.go +2 -2
  85. data/tracks/go/exercises/custom-set/custom_set_test.go +0 -8
  86. data/tracks/go/exercises/custom-set/example.go +0 -2
  87. data/tracks/go/exercises/custom-set/example_slice.go +0 -2
  88. data/tracks/go/exercises/diamond/diamond_test.go +0 -8
  89. data/tracks/go/exercises/diamond/example.go +0 -2
  90. data/tracks/go/exercises/difference-of-squares/difference_of_squares_test.go +0 -8
  91. data/tracks/go/exercises/difference-of-squares/example.go +0 -2
  92. data/tracks/go/exercises/diffie-hellman/diffie_hellman_test.go +0 -8
  93. data/tracks/go/exercises/diffie-hellman/example.go +0 -2
  94. data/tracks/go/exercises/error-handling/error_handling_test.go +0 -7
  95. data/tracks/go/exercises/error-handling/example.go +0 -2
  96. data/tracks/go/exercises/etl/etl_test.go +0 -8
  97. data/tracks/go/exercises/etl/example.go +0 -2
  98. data/tracks/go/exercises/flatten-array/.meta/gen.go +52 -0
  99. data/tracks/go/exercises/flatten-array/README.md +35 -0
  100. data/tracks/go/exercises/flatten-array/cases_test.go +42 -0
  101. data/tracks/go/exercises/flatten-array/example.go +25 -0
  102. data/tracks/go/exercises/flatten-array/flatten_test.go +23 -0
  103. data/tracks/go/exercises/food-chain/example.go +0 -2
  104. data/tracks/go/exercises/food-chain/food_chain_test.go +0 -8
  105. data/tracks/go/exercises/forth/cases_test.go +2 -2
  106. data/tracks/go/exercises/forth/example.go +0 -2
  107. data/tracks/go/exercises/forth/forth_test.go +0 -8
  108. data/tracks/go/exercises/gigasecond/cases_test.go +2 -2
  109. data/tracks/go/exercises/gigasecond/example.go +0 -2
  110. data/tracks/go/exercises/gigasecond/gigasecond.go +13 -3
  111. data/tracks/go/exercises/gigasecond/gigasecond_test.go +0 -8
  112. data/tracks/go/exercises/grade-school/example.go +0 -2
  113. data/tracks/go/exercises/grade-school/grade_school_test.go +0 -8
  114. data/tracks/go/exercises/grains/example.go +0 -2
  115. data/tracks/go/exercises/grains/grains_test.go +0 -8
  116. data/tracks/go/exercises/hamming/.meta/hints.md +4 -0
  117. data/tracks/go/exercises/hamming/README.md +6 -0
  118. data/tracks/go/exercises/hamming/example.go +0 -2
  119. data/tracks/go/exercises/hamming/hamming.go +0 -2
  120. data/tracks/go/exercises/hamming/hamming_test.go +0 -8
  121. data/tracks/go/exercises/hello-world/hello_world.go +9 -1
  122. data/tracks/go/exercises/hexadecimal/example.go +0 -2
  123. data/tracks/go/exercises/hexadecimal/hexadecimal_test.go +0 -8
  124. data/tracks/go/exercises/house/example.go +0 -2
  125. data/tracks/go/exercises/house/house_test.go +0 -8
  126. data/tracks/go/exercises/isbn-verifier/README.md +60 -0
  127. data/tracks/go/exercises/isbn-verifier/example.go +57 -0
  128. data/tracks/go/exercises/isbn-verifier/isbn_verifier_test.go +35 -0
  129. data/tracks/go/exercises/isogram/example.go +0 -2
  130. data/tracks/go/exercises/isogram/isogram_test.go +0 -8
  131. data/tracks/go/exercises/kindergarten-garden/example.go +0 -2
  132. data/tracks/go/exercises/kindergarten-garden/kindergarten_garden_test.go +0 -8
  133. data/tracks/go/exercises/largest-series-product/cases_test.go +2 -2
  134. data/tracks/go/exercises/largest-series-product/example.go +0 -2
  135. data/tracks/go/exercises/largest-series-product/largest_series_product_test.go +0 -8
  136. data/tracks/go/exercises/leap/.meta/hints.md +14 -0
  137. data/tracks/go/exercises/leap/README.md +16 -0
  138. data/tracks/go/exercises/leap/cases_test.go +4 -4
  139. data/tracks/go/exercises/leap/example.go +0 -2
  140. data/tracks/go/exercises/leap/leap.go +11 -2
  141. data/tracks/go/exercises/leap/leap_test.go +0 -15
  142. data/tracks/go/exercises/ledger/example.go +0 -2
  143. data/tracks/go/exercises/ledger/ledger.go +0 -2
  144. data/tracks/go/exercises/ledger/ledger_test.go +0 -8
  145. data/tracks/go/exercises/luhn/cases_test.go +2 -2
  146. data/tracks/go/exercises/luhn/example.go +0 -2
  147. data/tracks/go/exercises/luhn/luhn_test.go +0 -8
  148. data/tracks/go/exercises/matrix/example.go +0 -2
  149. data/tracks/go/exercises/matrix/matrix_test.go +0 -8
  150. data/tracks/go/exercises/meetup/cases_test.go +2 -2
  151. data/tracks/go/exercises/meetup/example.go +0 -2
  152. data/tracks/go/exercises/meetup/meetup_test.go +0 -8
  153. data/tracks/go/exercises/minesweeper/example.go +0 -2
  154. data/tracks/go/exercises/minesweeper/minesweeper_test.go +0 -8
  155. data/tracks/go/exercises/nth-prime/example.go +0 -2
  156. data/tracks/go/exercises/nth-prime/nth_prime_test.go +0 -8
  157. data/tracks/go/exercises/nucleotide-count/example.go +0 -2
  158. data/tracks/go/exercises/nucleotide-count/nucleotide_count.go +26 -0
  159. data/tracks/go/exercises/nucleotide-count/nucleotide_count_test.go +0 -8
  160. data/tracks/go/exercises/ocr-numbers/example.go +0 -2
  161. data/tracks/go/exercises/ocr-numbers/ocr_numbers_test.go +0 -8
  162. data/tracks/go/exercises/octal/example.go +0 -2
  163. data/tracks/go/exercises/octal/octal_test.go +0 -8
  164. data/tracks/go/exercises/paasio/example.go +0 -2
  165. data/tracks/go/exercises/paasio/paasio_test.go +0 -8
  166. data/tracks/go/exercises/palindrome-products/example.go +0 -2
  167. data/tracks/go/exercises/palindrome-products/palindrome_products_test.go +0 -8
  168. data/tracks/go/exercises/pangram/example.go +0 -2
  169. data/tracks/go/exercises/pangram/pangram_test.go +2 -8
  170. data/tracks/go/exercises/parallel-letter-frequency/example.go +0 -2
  171. data/tracks/go/exercises/parallel-letter-frequency/parallel_letter_frequency_test.go +0 -8
  172. data/tracks/go/exercises/pascals-triangle/example.go +0 -2
  173. data/tracks/go/exercises/pascals-triangle/pascals_triangle_test.go +0 -8
  174. data/tracks/go/exercises/perfect-numbers/example.go +0 -2
  175. data/tracks/go/exercises/perfect-numbers/perfect_numbers_test.go +0 -8
  176. data/tracks/go/exercises/phone-number/cases_test.go +2 -2
  177. data/tracks/go/exercises/phone-number/example.go +0 -2
  178. data/tracks/go/exercises/phone-number/phone_number_test.go +0 -8
  179. data/tracks/go/exercises/pig-latin/example.go +0 -2
  180. data/tracks/go/exercises/pig-latin/pig_latin_test.go +0 -8
  181. data/tracks/go/exercises/poker/.meta/hints.md +7 -0
  182. data/tracks/go/exercises/poker/README.md +9 -0
  183. data/tracks/go/exercises/poker/cases_test.go +2 -2
  184. data/tracks/go/exercises/poker/example.go +0 -2
  185. data/tracks/go/exercises/poker/poker_test.go +0 -11
  186. data/tracks/go/exercises/pov/example.go +0 -2
  187. data/tracks/go/exercises/pov/pov_test.go +1 -9
  188. data/tracks/go/exercises/prime-factors/example.go +0 -2
  189. data/tracks/go/exercises/prime-factors/prime_factors_test.go +1 -9
  190. data/tracks/go/exercises/protein-translation/example.go +0 -2
  191. data/tracks/go/exercises/protein-translation/protein_translation_test.go +0 -8
  192. data/tracks/go/exercises/pythagorean-triplet/example.go +0 -2
  193. data/tracks/go/exercises/pythagorean-triplet/pythagorean_triplet_test.go +0 -8
  194. data/tracks/go/exercises/queen-attack/example.go +0 -2
  195. data/tracks/go/exercises/queen-attack/queen_attack_test.go +0 -8
  196. data/tracks/go/exercises/raindrops/.meta/hints.md +7 -0
  197. data/tracks/go/exercises/raindrops/cases_test.go +2 -2
  198. data/tracks/go/exercises/raindrops/example.go +0 -2
  199. data/tracks/go/exercises/raindrops/raindrops_test.go +0 -8
  200. data/tracks/go/exercises/react/example.go +0 -2
  201. data/tracks/go/exercises/react/react_test.go +0 -11
  202. data/tracks/go/exercises/rna-transcription/cases_test.go +2 -2
  203. data/tracks/go/exercises/rna-transcription/example.go +0 -2
  204. data/tracks/go/exercises/rna-transcription/rna_transcription.go +6 -0
  205. data/tracks/go/exercises/rna-transcription/rna_transcription_test.go +0 -8
  206. data/tracks/go/exercises/robot-name/example.go +0 -2
  207. data/tracks/go/exercises/robot-name/robot_name_test.go +0 -8
  208. data/tracks/go/exercises/robot-simulator/example.go +0 -1
  209. data/tracks/go/exercises/robot-simulator/robot_simulator_test.go +0 -8
  210. data/tracks/go/exercises/roman-numerals/cases_test.go +2 -2
  211. data/tracks/go/exercises/roman-numerals/example.go +0 -2
  212. data/tracks/go/exercises/roman-numerals/roman_numerals_test.go +0 -8
  213. data/tracks/go/exercises/rotational-cipher/README.md +56 -0
  214. data/tracks/go/exercises/rotational-cipher/example.go +20 -0
  215. data/tracks/go/exercises/rotational-cipher/rotational_cipher_test.go +86 -0
  216. data/tracks/go/exercises/run-length-encoding/README.md +31 -0
  217. data/tracks/go/exercises/run-length-encoding/example.go +53 -0
  218. data/tracks/go/exercises/run-length-encoding/run_length_encoding_test.go +59 -0
  219. data/tracks/go/exercises/saddle-points/example.go +0 -2
  220. data/tracks/go/exercises/saddle-points/saddle_points_test.go +0 -8
  221. data/tracks/go/exercises/say/.meta/gen.go +70 -0
  222. data/tracks/go/exercises/say/cases_test.go +88 -0
  223. data/tracks/go/exercises/say/example.go +12 -6
  224. data/tracks/go/exercises/say/say_test.go +17 -43
  225. data/tracks/go/exercises/scrabble-score/cases_test.go +2 -2
  226. data/tracks/go/exercises/scrabble-score/example.go +0 -3
  227. data/tracks/go/exercises/scrabble-score/scrabble_score_test.go +0 -8
  228. data/tracks/go/exercises/secret-handshake/cases_test.go +2 -2
  229. data/tracks/go/exercises/secret-handshake/example.go +0 -2
  230. data/tracks/go/exercises/secret-handshake/secret_handshake_test.go +0 -8
  231. data/tracks/go/exercises/series/example.go +0 -2
  232. data/tracks/go/exercises/series/series_test.go +0 -8
  233. data/tracks/go/exercises/sieve/example.go +0 -2
  234. data/tracks/go/exercises/sieve/sieve_test.go +0 -8
  235. data/tracks/go/exercises/simple-cipher/example.go +0 -2
  236. data/tracks/go/exercises/simple-cipher/simple_cipher_test.go +0 -8
  237. data/tracks/go/exercises/space-age/.meta/gen.go +56 -0
  238. data/tracks/go/exercises/space-age/README.md +42 -0
  239. data/tracks/go/exercises/space-age/cases_test.go +61 -0
  240. data/tracks/go/exercises/space-age/example.go +36 -0
  241. data/tracks/go/exercises/space-age/space_age_test.go +22 -0
  242. data/tracks/go/exercises/spiral-matrix/README.md +48 -0
  243. data/tracks/go/exercises/spiral-matrix/example.go +93 -0
  244. data/tracks/go/exercises/spiral-matrix/spiral_matrix_test.go +71 -0
  245. data/tracks/go/exercises/strain/example.go +0 -2
  246. data/tracks/go/exercises/strain/strain_test.go +0 -8
  247. data/tracks/go/exercises/sublist/.meta/gen.go +56 -0
  248. data/tracks/go/exercises/sublist/README.md +39 -0
  249. data/tracks/go/exercises/sublist/cases_test.go +115 -0
  250. data/tracks/go/exercises/sublist/example.go +49 -0
  251. data/tracks/go/exercises/sublist/sublist_test.go +22 -0
  252. data/tracks/go/exercises/sum-of-multiples/cases_test.go +4 -3
  253. data/tracks/go/exercises/sum-of-multiples/example.go +0 -2
  254. data/tracks/go/exercises/sum-of-multiples/sum_of_multiples_test.go +0 -8
  255. data/tracks/go/exercises/tournament/example.go +0 -2
  256. data/tracks/go/exercises/tournament/tournament_test.go +0 -11
  257. data/tracks/go/exercises/transpose/cases_test.go +2 -2
  258. data/tracks/go/exercises/transpose/example.go +0 -2
  259. data/tracks/go/exercises/transpose/transpose_test.go +0 -8
  260. data/tracks/go/exercises/tree-building/example.go +0 -2
  261. data/tracks/go/exercises/tree-building/tree_building.go +0 -2
  262. data/tracks/go/exercises/tree-building/tree_test.go +0 -11
  263. data/tracks/go/exercises/triangle/.meta/hints.md +10 -0
  264. data/tracks/go/exercises/triangle/example.go +0 -2
  265. data/tracks/go/exercises/triangle/triangle.go +21 -9
  266. data/tracks/go/exercises/triangle/triangle_test.go +0 -8
  267. data/tracks/go/exercises/trinary/example.go +0 -2
  268. data/tracks/go/exercises/trinary/trinary_test.go +0 -8
  269. data/tracks/go/exercises/twelve-days/example.go +0 -2
  270. data/tracks/go/exercises/twelve-days/twelve_days_test.go +0 -8
  271. data/tracks/go/exercises/two-fer/two_fer.go +2 -2
  272. data/tracks/go/exercises/variable-length-quantity/cases_test.go +2 -2
  273. data/tracks/go/exercises/variable-length-quantity/example.go +0 -2
  274. data/tracks/go/exercises/variable-length-quantity/variable_length_quantity_test.go +0 -8
  275. data/tracks/go/exercises/word-count/cases_test.go +2 -2
  276. data/tracks/go/exercises/word-count/example.go +0 -2
  277. data/tracks/go/exercises/word-count/word_count_test.go +4 -7
  278. data/tracks/go/exercises/word-search/.meta/gen.go +96 -0
  279. data/tracks/go/exercises/word-search/cases_test.go +154 -0
  280. data/tracks/go/exercises/word-search/example.go +0 -2
  281. data/tracks/go/exercises/word-search/word_search_test.go +16 -52
  282. data/tracks/go/exercises/wordy/example.go +0 -2
  283. data/tracks/go/exercises/wordy/wordy_test.go +0 -8
  284. data/tracks/go/gen/gen.go +4 -1
  285. data/tracks/java/exercises/phone-number/README.md +1 -1
  286. data/tracks/kotlin/exercises/phone-number/README.md +1 -1
  287. data/tracks/perl6/config.json +50 -0
  288. data/tracks/perl6/exercises/etl/ETL.pm6 +6 -0
  289. data/tracks/perl6/exercises/etl/Example.pm6 +7 -0
  290. data/tracks/perl6/exercises/etl/README.md +72 -0
  291. data/tracks/perl6/exercises/etl/etl.t +139 -0
  292. data/tracks/perl6/exercises/etl/example.yaml +35 -0
  293. data/tracks/perl6/exercises/hamming/Example.pm6 +6 -0
  294. data/tracks/perl6/exercises/hamming/Hamming.pm6 +4 -0
  295. data/tracks/perl6/exercises/hamming/README.md +61 -0
  296. data/tracks/perl6/exercises/hamming/example.yaml +22 -0
  297. data/tracks/perl6/exercises/hamming/hamming.t +175 -0
  298. data/tracks/perl6/exercises/meetup/Example.pm6 +37 -0
  299. data/tracks/perl6/exercises/meetup/Meetup.pm6 +4 -0
  300. data/tracks/perl6/exercises/meetup/README.md +48 -0
  301. data/tracks/perl6/exercises/meetup/example.yaml +48 -0
  302. data/tracks/perl6/exercises/meetup/meetup.t +907 -0
  303. data/tracks/perl6/exercises/pangram/Example.pm6 +5 -0
  304. data/tracks/perl6/exercises/pangram/Pangram.pm6 +4 -0
  305. data/tracks/perl6/exercises/pangram/README.md +34 -0
  306. data/tracks/perl6/exercises/pangram/example.yaml +17 -0
  307. data/tracks/perl6/exercises/pangram/pangram.t +125 -0
  308. data/tracks/perl6/exercises/phone-number/README.md +1 -1
  309. data/tracks/perl6/exercises/two-fer/Example.pm6 +14 -0
  310. data/tracks/perl6/exercises/two-fer/README.md +38 -0
  311. data/tracks/perl6/exercises/two-fer/TwoFer.pm6 +15 -0
  312. data/tracks/perl6/exercises/two-fer/example.yaml +43 -0
  313. data/tracks/perl6/exercises/two-fer/two-fer.t +82 -0
  314. data/tracks/php/config.json +13 -0
  315. data/tracks/php/exercises/rail-fence-cipher/README.md +80 -0
  316. data/tracks/php/exercises/rail-fence-cipher/example.php +61 -0
  317. data/tracks/php/exercises/rail-fence-cipher/rail-fence-cipher_test.php +76 -0
  318. data/tracks/purescript/.travis.yml +1 -1
  319. data/tracks/python/config.json +13 -0
  320. data/tracks/python/exercises/alphametics/example.py +42 -29
  321. data/tracks/python/exercises/crypto-square/crypto_square_test.py +20 -13
  322. data/tracks/python/exercises/crypto-square/example.py +1 -1
  323. data/tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py +15 -2
  324. data/tracks/python/exercises/phone-number/README.md +2 -1
  325. data/tracks/python/exercises/pov/README.md +53 -0
  326. data/tracks/python/exercises/pov/example.py +70 -0
  327. data/tracks/python/exercises/pov/pov.py +25 -0
  328. data/tracks/python/exercises/pov/pov_test.py +200 -0
  329. data/tracks/python/test/check-exercises.py +11 -1
  330. data/tracks/ruby/exercises/meetup/.meta/.version +1 -0
  331. data/tracks/ruby/exercises/meetup/.meta/generator/meetup_case.rb +11 -0
  332. data/tracks/ruby/exercises/meetup/.meta/solutions/meetup.rb +5 -0
  333. data/tracks/ruby/exercises/meetup/meetup_test.rb +48 -4
  334. metadata +90 -8
  335. data/tracks/go/exercises/accumulate/accumulate.go +0 -5
  336. data/tracks/go/exercises/clock/clock.go +0 -19
  337. data/tracks/go/exercises/pangram/pangram.go +0 -5
  338. data/tracks/go/exercises/raindrops/raindrops.go +0 -8
  339. data/tracks/go/exercises/twelve-days/HINTS.md +0 -2
  340. data/tracks/go/exercises/word-count/word_count.go +0 -9
@@ -0,0 +1,6 @@
1
+ unit module ETL:ver<1>;
2
+
3
+ no precompilation;
4
+
5
+ sub transform (%input) is export {
6
+ }
@@ -0,0 +1,7 @@
1
+ unit module ETL:ver<1>;
2
+
3
+ no precompilation;
4
+
5
+ sub transform ( Hash[Array[Str:D], Int:D] $_ --> Hash[Int:D, Str:D] ) is export {
6
+ Hash[Int:D, Str:D].new: .invert».&{ .key.lc => .value }
7
+ }
@@ -0,0 +1,72 @@
1
+ # ETL
2
+
3
+ We are going to do the `Transform` step of an Extract-Transform-Load.
4
+
5
+ ### ETL
6
+
7
+ Extract-Transform-Load (ETL) is a fancy way of saying, "We have some crufty, legacy data over in this system, and now we need it in this shiny new system over here, so
8
+ we're going to migrate this."
9
+
10
+ (Typically, this is followed by, "We're only going to need to run this
11
+ once." That's then typically followed by much forehead slapping and
12
+ moaning about how stupid we could possibly be.)
13
+
14
+ ### The goal
15
+
16
+ We're going to extract some scrabble scores from a legacy system.
17
+
18
+ The old system stored a list of letters per score:
19
+
20
+ - 1 point: "A", "E", "I", "O", "U", "L", "N", "R", "S", "T",
21
+ - 2 points: "D", "G",
22
+ - 3 points: "B", "C", "M", "P",
23
+ - 4 points: "F", "H", "V", "W", "Y",
24
+ - 5 points: "K",
25
+ - 8 points: "J", "X",
26
+ - 10 points: "Q", "Z",
27
+
28
+ The shiny new scrabble system instead stores the score per letter, which
29
+ makes it much faster and easier to calculate the score for a word. It
30
+ also stores the letters in lower-case regardless of the case of the
31
+ input letters:
32
+
33
+ - "a" is worth 1 point.
34
+ - "b" is worth 3 points.
35
+ - "c" is worth 3 points.
36
+ - "d" is worth 2 points.
37
+ - Etc.
38
+
39
+ Your mission, should you choose to accept it, is to transform the legacy data
40
+ format to the shiny new format.
41
+
42
+ ### Notes
43
+
44
+ A final note about scoring, Scrabble is played around the world in a
45
+ variety of languages, each with its own unique scoring table. For
46
+ example, an "E" is scored at 2 in the Māori-language version of the
47
+ game while being scored at 4 in the Hawaiian-language version.
48
+
49
+ ## Resources
50
+
51
+ Remember to check out the Perl 6 [documentation](https://docs.perl6.org/) and
52
+ [resources](https://perl6.org/resources/) pages for information, tips, and
53
+ examples if you get stuck.
54
+
55
+ ## Running the tests
56
+
57
+ There is a test suite and module included with the exercise.
58
+ The test suite (a file with the extension `.t`) will attempt to run routines
59
+ from the module (a file with the extension `.pm6`).
60
+ Add/modify routines in the module so that the tests will pass! You can view the
61
+ test data by executing the command `perl6 --doc *.t` (\* being the name of the
62
+ test suite), and run the test suite for the exercise by executing the command
63
+ `prove . --exec=perl6` in the exercise directory.
64
+ You can also add the `-v` flag e.g. `prove . --exec=perl6 -v` to display all
65
+ tests, including any optional tests marked as 'TODO'.
66
+
67
+ ## Source
68
+
69
+ The Jumpstart Lab team [http://jumpstartlab.com](http://jumpstartlab.com)
70
+
71
+ ## Submitting Incomplete Solutions
72
+ It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -0,0 +1,139 @@
1
+ #!/usr/bin/env perl6
2
+ use v6;
3
+ use Test;
4
+ use lib my $dir = $?FILE.IO.dirname;
5
+ use JSON::Fast;
6
+
7
+ my Str:D $exercise := 'ETL';
8
+ my Version:D $version = v1;
9
+ my Str $module //= $exercise;
10
+ plan 6;
11
+
12
+ use-ok $module or bail-out;
13
+ require ::($module);
14
+
15
+ if ::($exercise).^ver !~~ $version {
16
+ warn "\nExercise version mismatch. Further tests may fail!"
17
+ ~ "\n$exercise is $(::($exercise).^ver.gist). "
18
+ ~ "Test is $($version.gist).\n";
19
+ bail-out 'Example version must match test version.' if %*ENV<EXERCISM>;
20
+ }
21
+
22
+ require ::($module) <&transform>;
23
+
24
+ my $c-data = from-json $=pod.pop.contents;
25
+ =head2 Notes
26
+ =begin para
27
+ The test expects your returned C<Hash> to have
28
+ L<type constraints|https://docs.perl6.org/type/Hash#Constraint_value_types>.
29
+ Defined C<Str>s for the values, and defined C<Int>s for the keys.
30
+ =end para
31
+ for $c-data<cases>.values -> %case-set {
32
+ is-deeply(
33
+ transform(Hash[Array[Str:D], Int:D].new(
34
+ .<input>.pairs».&{
35
+ .key.Int => Array[Str:D](.value.Slip)
36
+ }
37
+ )),
38
+ Hash[Int:D, Str:D].new(.<expected>.pairs),
39
+ .<description>
40
+ ) for %case-set<cases>.values;
41
+ }
42
+
43
+ =head2 Canonical Data
44
+ =begin code
45
+
46
+ {
47
+ "exercise": "etl",
48
+ "version": "1.0.0",
49
+ "cases": [
50
+ {
51
+ "comments": [
52
+ "Note: The expected input data for these tests should have",
53
+ "integer keys (not stringified numbers as shown in the JSON below",
54
+ "Unless the language prohibits that, please implement these tests",
55
+ "such that keys are integers. e.g. in JavaScript, it might look ",
56
+ "like `transform( { 1: ['A'] } );`"
57
+ ],
58
+ "description": "transforms the a set of scrabble data previously indexed by the tile score to a set of data indexed by the tile letter",
59
+ "cases": [
60
+ {
61
+ "description": "a single letter",
62
+ "property": "transform",
63
+ "input": {
64
+ "1": ["A"]
65
+ },
66
+ "expected": {
67
+ "a": 1
68
+ }
69
+ },
70
+ {
71
+ "description": "single score with multiple letters",
72
+ "property": "transform",
73
+ "input": {
74
+ "1": ["A", "E", "I", "O", "U"]
75
+ },
76
+ "expected": {
77
+ "a": 1,
78
+ "e": 1,
79
+ "i": 1,
80
+ "o": 1,
81
+ "u": 1
82
+ }
83
+ },
84
+ {
85
+ "description": "multiple scores with multiple letters",
86
+ "property": "transform",
87
+ "input": {
88
+ "1": ["A", "E"],
89
+ "2": ["D", "G"]
90
+ },
91
+ "expected": {
92
+ "a": 1,
93
+ "d": 2,
94
+ "e": 1,
95
+ "g": 2
96
+ }
97
+ },
98
+ {
99
+ "description": "multiple scores with differing numbers of letters",
100
+ "property": "transform",
101
+ "input": {
102
+ "1": ["A", "E", "I", "O", "U", "L", "N", "R", "S", "T"],
103
+ "2": ["D", "G"],
104
+ "3": ["B", "C", "M", "P"],
105
+ "4": ["F", "H", "V", "W", "Y"],
106
+ "5": ["K"],
107
+ "8": ["J", "X"],
108
+ "10": ["Q", "Z"]
109
+ },
110
+ "expected": {
111
+ "a": 1, "b": 3, "c": 3, "d": 2, "e": 1,
112
+ "f": 4, "g": 2, "h": 4, "i": 1, "j": 8,
113
+ "k": 5, "l": 1, "m": 3, "n": 1, "o": 1,
114
+ "p": 3, "q": 10, "r": 1, "s": 1, "t": 1,
115
+ "u": 1, "v": 4, "w": 4, "x": 8, "y": 4,
116
+ "z": 10
117
+ }
118
+ }
119
+ ]
120
+ }
121
+ ]
122
+ }
123
+
124
+ =end code
125
+
126
+ unless %*ENV<EXERCISM> {
127
+ skip-rest 'exercism tests';
128
+ exit;
129
+ }
130
+
131
+ subtest 'canonical-data' => {
132
+ (my $c-data-file = "$dir/../../problem-specifications/exercises/{
133
+ $dir.IO.resolve.basename
134
+ }/canonical-data.json".IO.resolve) ~~ :f ??
135
+ is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'match problem-specifications' !!
136
+ flunk 'problem-specifications file not found';
137
+ }
138
+
139
+ INIT { $module = 'Example' if %*ENV<EXERCISM> }
@@ -0,0 +1,35 @@
1
+ exercise: ETL
2
+ version: 1
3
+ plan: 6
4
+ imports: '&transform'
5
+ tests: |-
6
+ =head2 Notes
7
+ =begin para
8
+ The test expects your returned C<Hash> to have
9
+ L<type constraints|https://docs.perl6.org/type/Hash#Constraint_value_types>.
10
+ Defined C<Str>s for the values, and defined C<Int>s for the keys.
11
+ =end para
12
+ for $c-data<cases>.values -> %case-set {
13
+ is-deeply(
14
+ transform(Hash[Array[Str:D], Int:D].new(
15
+ .<input>.pairs».&{
16
+ .key.Int => Array[Str:D](.value.Slip)
17
+ }
18
+ )),
19
+ Hash[Int:D, Str:D].new(.<expected>.pairs),
20
+ .<description>
21
+ ) for %case-set<cases>.values;
22
+ }
23
+
24
+ unit: module
25
+ example: |-
26
+ no precompilation;
27
+
28
+ sub transform ( Hash[Array[Str:D], Int:D] $_ --> Hash[Int:D, Str:D] ) is export {
29
+ Hash[Int:D, Str:D].new: .invert».&{ .key.lc => .value }
30
+ }
31
+ stub: |-
32
+ no precompilation;
33
+
34
+ sub transform (%input) is export {
35
+ }
@@ -0,0 +1,6 @@
1
+ unit module Hamming:ver<1>;
2
+
3
+ sub hamming-distance ( Str:D $strand1, Str:D $strand2 --> Int:D ) is export {
4
+ die ‘left and right strands must be of equal length’ if $strand1.chars ≠ $strand2.chars;
5
+ ($strand1.comb Zne $strand2.comb).sum
6
+ }
@@ -0,0 +1,4 @@
1
+ unit module Hamming:ver<1>;
2
+
3
+ sub hamming-distance ($strand1, $strand2) is export {
4
+ }
@@ -0,0 +1,61 @@
1
+ # Hamming
2
+
3
+ Calculate the Hamming difference between two DNA strands.
4
+
5
+ A mutation is simply a mistake that occurs during the creation or
6
+ copying of a nucleic acid, in particular DNA. Because nucleic acids are
7
+ vital to cellular functions, mutations tend to cause a ripple effect
8
+ throughout the cell. Although mutations are technically mistakes, a very
9
+ rare mutation may equip the cell with a beneficial attribute. In fact,
10
+ the macro effects of evolution are attributable by the accumulated
11
+ result of beneficial microscopic mutations over many generations.
12
+
13
+ The simplest and most common type of nucleic acid mutation is a point
14
+ mutation, which replaces one base with another at a single nucleotide.
15
+
16
+ By counting the number of differences between two homologous DNA strands
17
+ taken from different genomes with a common ancestor, we get a measure of
18
+ the minimum number of point mutations that could have occurred on the
19
+ evolutionary path between the two strands.
20
+
21
+ This is called the 'Hamming distance'.
22
+
23
+ It is found by comparing two DNA strands and counting how many of the
24
+ nucleotides are different from their equivalent in the other string.
25
+
26
+ GAGCCTACTAACGGGAT
27
+ CATCGTAATGACGGCCT
28
+ ^ ^ ^ ^ ^ ^^
29
+
30
+ The Hamming distance between these two DNA strands is 7.
31
+
32
+ # Implementation notes
33
+
34
+ The Hamming distance is only defined for sequences of equal length. This means
35
+ that based on the definition, each language could deal with getting sequences
36
+ of equal length differently.
37
+
38
+ ## Resources
39
+
40
+ Remember to check out the Perl 6 [documentation](https://docs.perl6.org/) and
41
+ [resources](https://perl6.org/resources/) pages for information, tips, and
42
+ examples if you get stuck.
43
+
44
+ ## Running the tests
45
+
46
+ There is a test suite and module included with the exercise.
47
+ The test suite (a file with the extension `.t`) will attempt to run routines
48
+ from the module (a file with the extension `.pm6`).
49
+ Add/modify routines in the module so that the tests will pass! You can view the
50
+ test data by executing the command `perl6 --doc *.t` (\* being the name of the
51
+ test suite), and run the test suite for the exercise by executing the command
52
+ `prove . --exec=perl6` in the exercise directory.
53
+ You can also add the `-v` flag e.g. `prove . --exec=perl6 -v` to display all
54
+ tests, including any optional tests marked as 'TODO'.
55
+
56
+ ## Source
57
+
58
+ The Calculating Point Mutations problem at Rosalind [http://rosalind.info/problems/hamm/](http://rosalind.info/problems/hamm/)
59
+
60
+ ## Submitting Incomplete Solutions
61
+ It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -0,0 +1,22 @@
1
+ exercise: Hamming
2
+ version: 1
3
+ plan: 17
4
+ imports: '&hamming-distance'
5
+ tests: |-
6
+ for $c-data<cases>.values {
7
+ if .<expected><error> {
8
+ throws-like {hamming-distance(|.<strand1 strand2>)}, Exception, .<description>, message => .<expected><error>;
9
+ } else {
10
+ is hamming-distance(|.<strand1 strand2>), |.<expected description>;
11
+ }
12
+ }
13
+
14
+ unit: module
15
+ example: |-
16
+ sub hamming-distance ( Str:D $strand1, Str:D $strand2 --> Int:D ) is export {
17
+ die ‘left and right strands must be of equal length’ if $strand1.chars ≠ $strand2.chars;
18
+ ($strand1.comb Zne $strand2.comb).sum
19
+ }
20
+ stub: |-
21
+ sub hamming-distance ($strand1, $strand2) is export {
22
+ }
@@ -0,0 +1,175 @@
1
+ #!/usr/bin/env perl6
2
+ use v6;
3
+ use Test;
4
+ use lib my $dir = $?FILE.IO.dirname;
5
+ use JSON::Fast;
6
+
7
+ my Str:D $exercise := 'Hamming';
8
+ my Version:D $version = v1;
9
+ my Str $module //= $exercise;
10
+ plan 17;
11
+
12
+ use-ok $module or bail-out;
13
+ require ::($module);
14
+
15
+ if ::($exercise).^ver !~~ $version {
16
+ warn "\nExercise version mismatch. Further tests may fail!"
17
+ ~ "\n$exercise is $(::($exercise).^ver.gist). "
18
+ ~ "Test is $($version.gist).\n";
19
+ bail-out 'Example version must match test version.' if %*ENV<EXERCISM>;
20
+ }
21
+
22
+ require ::($module) <&hamming-distance>;
23
+
24
+ my $c-data = from-json $=pod.pop.contents;
25
+ for $c-data<cases>.values {
26
+ if .<expected><error> {
27
+ throws-like {hamming-distance(|.<strand1 strand2>)}, Exception, .<description>, message => .<expected><error>;
28
+ } else {
29
+ is hamming-distance(|.<strand1 strand2>), |.<expected description>;
30
+ }
31
+ }
32
+
33
+ =head2 Canonical Data
34
+ =begin code
35
+
36
+ {
37
+ "exercise": "hamming",
38
+ "version": "2.0.1",
39
+ "comments": [
40
+ "Language implementations vary on the issue of unequal length strands.",
41
+ "A language may elect to simplify this task by only presenting equal",
42
+ "length test cases. For languages handling unequal length strands as",
43
+ "error condition, unequal length test cases are included here and are",
44
+ "indicated with an expected value of -1. Note however that -1 is",
45
+ "simply an indication here in the JSON. Actually returning -1 from",
46
+ "a hamming distance function may or may not be idiomatic in a language.",
47
+ "Language idioms of errors or exceptions should be followed.",
48
+ "Alternative interpretations such as ignoring excess length at the end",
49
+ "are not represented here."
50
+ ],
51
+ "cases": [
52
+ {
53
+ "description": "empty strands",
54
+ "property": "distance",
55
+ "strand1": "",
56
+ "strand2": "",
57
+ "expected": 0
58
+ },
59
+ {
60
+ "description": "identical strands",
61
+ "property": "distance",
62
+ "strand1": "A",
63
+ "strand2": "A",
64
+ "expected": 0
65
+ },
66
+ {
67
+ "description": "long identical strands",
68
+ "property": "distance",
69
+ "strand1": "GGACTGA",
70
+ "strand2": "GGACTGA",
71
+ "expected": 0
72
+ },
73
+ {
74
+ "description": "complete distance in single nucleotide strands",
75
+ "property": "distance",
76
+ "strand1": "A",
77
+ "strand2": "G",
78
+ "expected": 1
79
+ },
80
+ {
81
+ "description": "complete distance in small strands",
82
+ "property": "distance",
83
+ "strand1": "AG",
84
+ "strand2": "CT",
85
+ "expected": 2
86
+ },
87
+ {
88
+ "description": "small distance in small strands",
89
+ "property": "distance",
90
+ "strand1": "AT",
91
+ "strand2": "CT",
92
+ "expected": 1
93
+ },
94
+ {
95
+ "description": "small distance",
96
+ "property": "distance",
97
+ "strand1": "GGACG",
98
+ "strand2": "GGTCG",
99
+ "expected": 1
100
+ },
101
+ {
102
+ "description": "small distance in long strands",
103
+ "property": "distance",
104
+ "strand1": "ACCAGGG",
105
+ "strand2": "ACTATGG",
106
+ "expected": 2
107
+ },
108
+ {
109
+ "description": "non-unique character in first strand",
110
+ "property": "distance",
111
+ "strand1": "AAG",
112
+ "strand2": "AAA",
113
+ "expected": 1
114
+ },
115
+ {
116
+ "description": "non-unique character in second strand",
117
+ "property": "distance",
118
+ "strand1": "AAA",
119
+ "strand2": "AAG",
120
+ "expected": 1
121
+ },
122
+ {
123
+ "description": "same nucleotides in different positions",
124
+ "property": "distance",
125
+ "strand1": "TAG",
126
+ "strand2": "GAT",
127
+ "expected": 2
128
+ },
129
+ {
130
+ "description": "large distance",
131
+ "property": "distance",
132
+ "strand1": "GATACA",
133
+ "strand2": "GCATAA",
134
+ "expected": 4
135
+ },
136
+ {
137
+ "description": "large distance in off-by-one strand",
138
+ "property": "distance",
139
+ "strand1": "GGACGGATTCTG",
140
+ "strand2": "AGGACGGATTCT",
141
+ "expected": 9
142
+ },
143
+ {
144
+ "description": "disallow first strand longer",
145
+ "property": "distance",
146
+ "strand1": "AATG",
147
+ "strand2": "AAA",
148
+ "expected": {"error": "left and right strands must be of equal length"}
149
+ },
150
+ {
151
+ "description": "disallow second strand longer",
152
+ "property": "distance",
153
+ "strand1": "ATA",
154
+ "strand2": "AGTG",
155
+ "expected": {"error": "left and right strands must be of equal length"}
156
+ }
157
+ ]
158
+ }
159
+
160
+ =end code
161
+
162
+ unless %*ENV<EXERCISM> {
163
+ skip-rest 'exercism tests';
164
+ exit;
165
+ }
166
+
167
+ subtest 'canonical-data' => {
168
+ (my $c-data-file = "$dir/../../problem-specifications/exercises/{
169
+ $dir.IO.resolve.basename
170
+ }/canonical-data.json".IO.resolve) ~~ :f ??
171
+ is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'match problem-specifications' !!
172
+ flunk 'problem-specifications file not found';
173
+ }
174
+
175
+ INIT { $module = 'Example' if %*ENV<EXERCISM> }