trackler 2.2.1.107 → 2.2.1.108

Sign up to get free protection for your applications and to get access to all the features.
Files changed (397) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/exercises/pig-latin/description.md +4 -4
  4. data/tracks/c/config.json +42 -0
  5. data/tracks/c/exercises/bracket-push/README.md +3 -0
  6. data/tracks/c/exercises/bracket-push/makefile +25 -0
  7. data/tracks/c/exercises/bracket-push/src/example.c +52 -0
  8. data/tracks/c/exercises/bracket-push/src/example.h +7 -0
  9. data/tracks/c/exercises/bracket-push/test/test_bracket_push.c +132 -0
  10. data/tracks/c/exercises/bracket-push/test/vendor/unity.c +1300 -0
  11. data/tracks/c/exercises/bracket-push/test/vendor/unity.h +274 -0
  12. data/tracks/c/exercises/bracket-push/test/vendor/unity_internals.h +701 -0
  13. data/tracks/c/exercises/etl/README.md +46 -0
  14. data/tracks/c/exercises/etl/makefile +25 -0
  15. data/tracks/c/exercises/etl/src/example.c +44 -0
  16. data/tracks/c/exercises/etl/src/example.h +18 -0
  17. data/tracks/c/exercises/etl/test/test_etl.c +120 -0
  18. data/tracks/c/exercises/etl/test/vendor/unity.c +1300 -0
  19. data/tracks/c/exercises/etl/test/vendor/unity.h +274 -0
  20. data/tracks/c/exercises/etl/test/vendor/unity_internals.h +701 -0
  21. data/tracks/c/exercises/luhn/README.md +64 -0
  22. data/tracks/c/exercises/luhn/makefile +25 -0
  23. data/tracks/c/exercises/luhn/src/example.c +38 -0
  24. data/tracks/c/exercises/luhn/src/example.h +7 -0
  25. data/tracks/c/exercises/luhn/test/test_luhn.c +109 -0
  26. data/tracks/c/exercises/luhn/test/vendor/unity.c +1300 -0
  27. data/tracks/c/exercises/luhn/test/vendor/unity.h +274 -0
  28. data/tracks/c/exercises/luhn/test/vendor/unity_internals.h +701 -0
  29. data/tracks/c/exercises/prime-factors/README.md +29 -0
  30. data/tracks/c/exercises/prime-factors/makefile +25 -0
  31. data/tracks/c/exercises/prime-factors/src/example.c +28 -0
  32. data/tracks/c/exercises/prime-factors/src/example.h +11 -0
  33. data/tracks/c/exercises/prime-factors/test/test_prime_factors.c +96 -0
  34. data/tracks/c/exercises/prime-factors/test/vendor/unity.c +1300 -0
  35. data/tracks/c/exercises/prime-factors/test/vendor/unity.h +274 -0
  36. data/tracks/c/exercises/prime-factors/test/vendor/unity_internals.h +701 -0
  37. data/tracks/clojure/exercises/hello-world/src/example.clj +2 -3
  38. data/tracks/clojure/exercises/hello-world/test/hello_world_test.clj +0 -6
  39. data/tracks/common-lisp/README.md +3 -8
  40. data/tracks/common-lisp/config/exercise_readme.go.tmpl +1 -1
  41. data/tracks/common-lisp/exercises/acronym/README.md +1 -1
  42. data/tracks/common-lisp/exercises/acronym/acronym-test.lisp +0 -5
  43. data/tracks/common-lisp/exercises/allergies/README.md +1 -1
  44. data/tracks/common-lisp/exercises/anagram/README.md +1 -1
  45. data/tracks/common-lisp/exercises/atbash-cipher/README.md +1 -1
  46. data/tracks/common-lisp/exercises/beer-song/README.md +1 -1
  47. data/tracks/common-lisp/exercises/binary/README.md +1 -1
  48. data/tracks/common-lisp/exercises/bob/README.md +1 -1
  49. data/tracks/common-lisp/exercises/collatz-conjecture/README.md +1 -1
  50. data/tracks/common-lisp/exercises/crypto-square/README.md +1 -1
  51. data/tracks/common-lisp/exercises/difference-of-squares/README.md +1 -1
  52. data/tracks/common-lisp/exercises/etl/README.md +1 -1
  53. data/tracks/common-lisp/exercises/gigasecond/README.md +1 -1
  54. data/tracks/common-lisp/exercises/grade-school/README.md +1 -1
  55. data/tracks/common-lisp/exercises/grains/README.md +1 -1
  56. data/tracks/common-lisp/exercises/hamming/README.md +1 -1
  57. data/tracks/common-lisp/exercises/hello-world/README.md +1 -1
  58. data/tracks/common-lisp/exercises/isogram/README.md +1 -1
  59. data/tracks/common-lisp/exercises/leap/README.md +1 -1
  60. data/tracks/common-lisp/exercises/meetup/README.md +1 -1
  61. data/tracks/common-lisp/exercises/nucleotide-count/README.md +1 -1
  62. data/tracks/common-lisp/exercises/pascals-triangle/README.md +1 -1
  63. data/tracks/common-lisp/exercises/perfect-numbers/README.md +1 -1
  64. data/tracks/common-lisp/exercises/phone-number/README.md +1 -1
  65. data/tracks/common-lisp/exercises/prime-factors/README.md +1 -1
  66. data/tracks/common-lisp/exercises/raindrops/README.md +1 -1
  67. data/tracks/common-lisp/exercises/rna-transcription/README.md +1 -1
  68. data/tracks/common-lisp/exercises/robot-name/README.md +1 -1
  69. data/tracks/common-lisp/exercises/roman-numerals/README.md +1 -1
  70. data/tracks/common-lisp/exercises/scrabble-score/README.md +1 -1
  71. data/tracks/common-lisp/exercises/sieve/README.md +1 -1
  72. data/tracks/common-lisp/exercises/space-age/README.md +1 -1
  73. data/tracks/common-lisp/exercises/strain/README.md +1 -1
  74. data/tracks/common-lisp/exercises/sublist/README.md +1 -1
  75. data/tracks/common-lisp/exercises/triangle/README.md +1 -1
  76. data/tracks/common-lisp/exercises/trinary/README.md +1 -1
  77. data/tracks/common-lisp/exercises/word-count/README.md +1 -1
  78. data/tracks/csharp/exercises/meetup/MeetupTest.cs +177 -177
  79. data/tracks/csharp/exercises/robot-simulator/Example.cs +27 -27
  80. data/tracks/csharp/exercises/robot-simulator/RobotSimulator.cs +3 -3
  81. data/tracks/csharp/exercises/robot-simulator/RobotSimulatorTest.cs +152 -31
  82. data/tracks/csharp/generators/Exercises/Meetup.cs +8 -9
  83. data/tracks/csharp/generators/Exercises/RobotSimulator.cs +116 -0
  84. data/tracks/delphi/exercises/allergies/uAllergyTests.pas +28 -0
  85. data/tracks/delphi/exercises/binary-search/uBinarySearchExample.pas +6 -0
  86. data/tracks/delphi/exercises/binary-search/uBinarySearchTest.pas +53 -37
  87. data/tracks/delphi/exercises/collatz-conjecture/uCollatzconjectureTest.pas +3 -0
  88. data/tracks/delphi/exercises/etl/uETLtests.pas +13 -10
  89. data/tracks/delphi/exercises/grains/uGrainsTests.pas +5 -2
  90. data/tracks/delphi/exercises/hamming/uHammingTests.pas +3 -0
  91. data/tracks/delphi/exercises/hello-world/uTestHelloWorld.pas +3 -0
  92. data/tracks/delphi/exercises/leap/uLeapTests.pas +3 -0
  93. data/tracks/delphi/exercises/minesweeper/uMineSweeperTest.pas +3 -0
  94. data/tracks/delphi/exercises/nucleotide-count/uNucleotideCountTest.pas +5 -17
  95. data/tracks/delphi/exercises/perfect-numbers/uPerfectNumbersExample.pas +6 -0
  96. data/tracks/delphi/exercises/perfect-numbers/uPerfectNumbersTest.pas +77 -26
  97. data/tracks/delphi/exercises/pig-latin/README.md +4 -4
  98. data/tracks/delphi/exercises/pig-latin/uTestPigLatin.pas +12 -9
  99. data/tracks/delphi/exercises/poker/uPokerExample.pas +81 -26
  100. data/tracks/delphi/exercises/poker/uPokerTest.pas +343 -121
  101. data/tracks/delphi/exercises/raindrops/uRaindropsTest.pas +3 -0
  102. data/tracks/delphi/exercises/saddle-points/uSaddlePointsExample.pas +4 -3
  103. data/tracks/delphi/exercises/saddle-points/uSaddlePointsTests.pas +25 -47
  104. data/tracks/delphi/exercises/triangle/uTestTriangle.pas +4 -2
  105. data/tracks/delphi/exercises/two-fer/utwoferTest.pas +3 -0
  106. data/tracks/delphi/exercises/wordy/uWordyTests.pas +3 -0
  107. data/tracks/ecmascript/.travis.yml +2 -1
  108. data/tracks/ecmascript/config.json +14 -0
  109. data/tracks/ecmascript/exercises/accumulate/package.json +1 -2
  110. data/tracks/ecmascript/exercises/acronym/package.json +1 -2
  111. data/tracks/ecmascript/exercises/all-your-base/package.json +1 -2
  112. data/tracks/ecmascript/exercises/allergies/package.json +1 -2
  113. data/tracks/ecmascript/exercises/alphametics/package.json +1 -2
  114. data/tracks/ecmascript/exercises/anagram/package.json +1 -2
  115. data/tracks/ecmascript/exercises/atbash-cipher/package.json +1 -2
  116. data/tracks/ecmascript/exercises/beer-song/package.json +1 -2
  117. data/tracks/ecmascript/exercises/binary-search-tree/package.json +1 -2
  118. data/tracks/ecmascript/exercises/binary-search/package.json +1 -2
  119. data/tracks/ecmascript/exercises/binary/package.json +1 -2
  120. data/tracks/ecmascript/exercises/bob/README.md +2 -0
  121. data/tracks/ecmascript/exercises/bob/bob.spec.js +5 -5
  122. data/tracks/ecmascript/exercises/bob/example.js +7 -2
  123. data/tracks/ecmascript/exercises/bob/package.json +1 -2
  124. data/tracks/ecmascript/exercises/bowling/package.json +1 -2
  125. data/tracks/ecmascript/exercises/bracket-push/package.json +1 -2
  126. data/tracks/ecmascript/exercises/change/package.json +1 -2
  127. data/tracks/ecmascript/exercises/circular-buffer/package.json +1 -2
  128. data/tracks/ecmascript/exercises/clock/package.json +1 -2
  129. data/tracks/ecmascript/exercises/collatz-conjecture/package.json +1 -2
  130. data/tracks/ecmascript/exercises/complex-numbers/package.json +1 -2
  131. data/tracks/ecmascript/exercises/connect/package.json +1 -2
  132. data/tracks/ecmascript/exercises/crypto-square/package.json +1 -2
  133. data/tracks/ecmascript/exercises/custom-set/package.json +1 -2
  134. data/tracks/ecmascript/exercises/diamond/package.json +1 -2
  135. data/tracks/ecmascript/exercises/difference-of-squares/package.json +1 -2
  136. data/tracks/ecmascript/exercises/diffie-hellman/package.json +1 -2
  137. data/tracks/ecmascript/exercises/etl/package.json +1 -2
  138. data/tracks/ecmascript/exercises/flatten-array/package.json +1 -2
  139. data/tracks/ecmascript/exercises/food-chain/package.json +1 -2
  140. data/tracks/ecmascript/exercises/gigasecond/package.json +1 -2
  141. data/tracks/ecmascript/exercises/grade-school/package.json +1 -2
  142. data/tracks/ecmascript/exercises/grains/package.json +1 -2
  143. data/tracks/ecmascript/exercises/hamming/package.json +1 -2
  144. data/tracks/ecmascript/exercises/hello-world/package.json +1 -2
  145. data/tracks/ecmascript/exercises/hexadecimal/package.json +1 -2
  146. data/tracks/ecmascript/exercises/house/package.json +1 -2
  147. data/tracks/ecmascript/exercises/isbn-verifier/package.json +1 -2
  148. data/tracks/ecmascript/exercises/isogram/package.json +1 -2
  149. data/tracks/ecmascript/exercises/kindergarten-garden/package.json +1 -2
  150. data/tracks/ecmascript/exercises/largest-series-product/package.json +1 -2
  151. data/tracks/ecmascript/exercises/leap/package.json +1 -2
  152. data/tracks/ecmascript/exercises/linked-list/package.json +1 -2
  153. data/tracks/ecmascript/exercises/list-ops/package.json +1 -2
  154. data/tracks/ecmascript/exercises/luhn/package.json +1 -2
  155. data/tracks/ecmascript/exercises/matrix/package.json +1 -2
  156. data/tracks/ecmascript/exercises/meetup/package.json +1 -2
  157. data/tracks/ecmascript/exercises/minesweeper/package.json +1 -2
  158. data/tracks/ecmascript/exercises/nth-prime/package.json +1 -2
  159. data/tracks/ecmascript/exercises/nucleotide-count/README.md +60 -0
  160. data/tracks/ecmascript/exercises/nucleotide-count/example.js +13 -0
  161. data/tracks/ecmascript/exercises/nucleotide-count/nucleotide-count.spec.js +23 -0
  162. data/tracks/ecmascript/exercises/nucleotide-count/package.json +70 -0
  163. data/tracks/ecmascript/exercises/ocr-numbers/package.json +1 -2
  164. data/tracks/ecmascript/exercises/octal/package.json +1 -2
  165. data/tracks/ecmascript/exercises/palindrome-products/package.json +1 -2
  166. data/tracks/ecmascript/exercises/pangram/package.json +1 -2
  167. data/tracks/ecmascript/exercises/pascals-triangle/package.json +1 -2
  168. data/tracks/ecmascript/exercises/perfect-numbers/package.json +1 -2
  169. data/tracks/ecmascript/exercises/phone-number/package.json +1 -2
  170. data/tracks/ecmascript/exercises/pig-latin/package.json +1 -2
  171. data/tracks/ecmascript/exercises/prime-factors/package.json +1 -2
  172. data/tracks/ecmascript/exercises/protein-translation/package.json +1 -2
  173. data/tracks/ecmascript/exercises/proverb/package.json +1 -2
  174. data/tracks/ecmascript/exercises/pythagorean-triplet/package.json +1 -2
  175. data/tracks/ecmascript/exercises/queen-attack/package.json +1 -2
  176. data/tracks/ecmascript/exercises/raindrops/package.json +1 -2
  177. data/tracks/ecmascript/exercises/react/package.json +1 -2
  178. data/tracks/ecmascript/exercises/rectangles/package.json +1 -2
  179. data/tracks/ecmascript/exercises/rna-transcription/package.json +1 -2
  180. data/tracks/ecmascript/exercises/robot-name/package.json +1 -2
  181. data/tracks/ecmascript/exercises/robot-simulator/package.json +1 -2
  182. data/tracks/ecmascript/exercises/roman-numerals/package.json +1 -2
  183. data/tracks/ecmascript/exercises/rotational-cipher/package.json +1 -2
  184. data/tracks/ecmascript/exercises/run-length-encoding/package.json +1 -2
  185. data/tracks/ecmascript/exercises/saddle-points/package.json +1 -2
  186. data/tracks/ecmascript/exercises/say/package.json +1 -2
  187. data/tracks/ecmascript/exercises/scrabble-score/package.json +1 -2
  188. data/tracks/ecmascript/exercises/secret-handshake/package.json +1 -2
  189. data/tracks/ecmascript/exercises/series/package.json +1 -2
  190. data/tracks/ecmascript/exercises/sieve/package.json +1 -2
  191. data/tracks/ecmascript/exercises/simple-cipher/package.json +1 -2
  192. data/tracks/ecmascript/exercises/simple-linked-list/package.json +1 -2
  193. data/tracks/ecmascript/exercises/space-age/package.json +1 -2
  194. data/tracks/ecmascript/exercises/spiral-matrix/package.json +1 -2
  195. data/tracks/ecmascript/exercises/strain/package.json +1 -2
  196. data/tracks/ecmascript/exercises/sublist/package.json +1 -2
  197. data/tracks/ecmascript/exercises/sum-of-multiples/package.json +1 -2
  198. data/tracks/ecmascript/exercises/transpose/package.json +1 -2
  199. data/tracks/ecmascript/exercises/triangle/package.json +1 -2
  200. data/tracks/ecmascript/exercises/trinary/package.json +1 -2
  201. data/tracks/ecmascript/exercises/twelve-days/package.json +1 -2
  202. data/tracks/ecmascript/exercises/two-bucket/package.json +1 -2
  203. data/tracks/ecmascript/exercises/two-fer/package.json +1 -2
  204. data/tracks/ecmascript/exercises/word-count/package.json +1 -2
  205. data/tracks/ecmascript/exercises/word-search/package.json +1 -2
  206. data/tracks/ecmascript/exercises/wordy/package.json +1 -2
  207. data/tracks/ecmascript/package.json +1 -2
  208. data/tracks/elm/config.json +13 -1
  209. data/tracks/elm/exercises/binary-search/BinarySearch.elm +9 -0
  210. data/tracks/elm/exercises/binary-search/BinarySearch.example.elm +36 -0
  211. data/tracks/elm/exercises/binary-search/README.md +71 -0
  212. data/tracks/elm/exercises/binary-search/elm-package.json +15 -0
  213. data/tracks/elm/exercises/binary-search/tests/Tests.elm +66 -0
  214. data/tracks/elm/exercises/binary-search/tests/elm-package.json +17 -0
  215. data/tracks/elm/exercises/hamming/Hamming.example.elm +3 -3
  216. data/tracks/elm/exercises/hamming/tests/Tests.elm +14 -14
  217. data/tracks/go/exercises/word-search/.meta/gen.go +9 -7
  218. data/tracks/go/exercises/word-search/cases_test.go +2 -2
  219. data/tracks/groovy/config.json +12 -0
  220. data/tracks/groovy/exercises/bank-account/BankAccount.groovy +30 -0
  221. data/tracks/groovy/exercises/bank-account/BankAccountSpec.groovy +200 -0
  222. data/tracks/groovy/exercises/bank-account/Example.groovy +47 -0
  223. data/tracks/groovy/exercises/bank-account/README.md +75 -0
  224. data/tracks/groovy/exercises/phone-number/Example.groovy +10 -14
  225. data/tracks/groovy/exercises/phone-number/PhoneNumber.groovy +2 -14
  226. data/tracks/groovy/exercises/phone-number/PhoneNumberSpec.groovy +39 -26
  227. data/tracks/groovy/exercises/phone-number/README.md +1 -1
  228. data/tracks/java/config.json +13 -0
  229. data/tracks/java/exercises/forth/README.md +10 -0
  230. data/tracks/java/exercises/rna-transcription/.meta/version +1 -1
  231. data/tracks/java/exercises/settings.gradle +1 -0
  232. data/tracks/java/exercises/sieve/.meta/version +1 -1
  233. data/tracks/java/exercises/spiral-matrix/.meta/version +1 -1
  234. data/tracks/java/exercises/triangle/.meta/version +1 -1
  235. data/tracks/java/exercises/two-bucket/README.md +1 -1
  236. data/tracks/java/exercises/zipper/.meta/src/reference/java/Zipper.java +199 -0
  237. data/tracks/java/exercises/zipper/.meta/version +1 -0
  238. data/tracks/java/exercises/zipper/README.md +42 -0
  239. data/tracks/java/exercises/zipper/build.gradle +18 -0
  240. data/tracks/java/exercises/zipper/src/main/java/.keep +0 -0
  241. data/tracks/java/exercises/zipper/src/test/java/ZipperTest.java +204 -0
  242. data/tracks/javascript/package.json +10 -0
  243. data/tracks/ocaml/.travis-ci.sh +1 -1
  244. data/tracks/ocaml/.travis.yml +1 -1
  245. data/tracks/ocaml/README.md +1 -1
  246. data/tracks/ocaml/config/exercise_readme.go.tmpl +2 -0
  247. data/tracks/python/config.json +13 -0
  248. data/tracks/python/exercises/all-your-base/all_your_base.py +1 -1
  249. data/tracks/python/exercises/all-your-base/all_your_base_test.py +8 -8
  250. data/tracks/python/exercises/alphametics/alphametics_test.py +49 -9
  251. data/tracks/python/exercises/binary-search-tree/binary_search_tree.py +11 -5
  252. data/tracks/python/exercises/binary-search-tree/binary_search_tree_test.py +89 -48
  253. data/tracks/python/exercises/binary-search-tree/example.py +42 -52
  254. data/tracks/python/exercises/binary-search/binary_search_test.py +1 -1
  255. data/tracks/python/exercises/book-store/book_store_test.py +18 -39
  256. data/tracks/python/exercises/book-store/example.py +1 -1
  257. data/tracks/python/exercises/bowling/bowling.py +0 -2
  258. data/tracks/python/exercises/bowling/bowling_test.py +49 -13
  259. data/tracks/python/exercises/bowling/example.py +85 -135
  260. data/tracks/python/exercises/bracket-push/bracket_push.py +1 -1
  261. data/tracks/python/exercises/bracket-push/bracket_push_test.py +16 -16
  262. data/tracks/python/exercises/bracket-push/example.py +2 -2
  263. data/tracks/python/exercises/change/change_test.py +17 -4
  264. data/tracks/python/exercises/change/example.py +2 -2
  265. data/tracks/python/exercises/circular-buffer/circular_buffer.py +12 -0
  266. data/tracks/python/exercises/circular-buffer/circular_buffer_test.py +4 -11
  267. data/tracks/python/exercises/clock/clock.py +10 -1
  268. data/tracks/python/exercises/clock/clock_test.py +9 -9
  269. data/tracks/python/exercises/clock/example.py +4 -1
  270. data/tracks/python/exercises/collatz-conjecture/collatz_conjecture_test.py +15 -5
  271. data/tracks/python/exercises/collatz-conjecture/example.py +1 -1
  272. data/tracks/python/exercises/complex-numbers/complex_numbers_test.py +37 -26
  273. data/tracks/python/exercises/custom-set/custom_set_test.py +1 -1
  274. data/tracks/python/exercises/diamond/diamond_test.py +1 -1
  275. data/tracks/python/exercises/dominoes/dominoes_test.py +1 -1
  276. data/tracks/python/exercises/forth/forth_test.py +1 -1
  277. data/tracks/python/exercises/house/example.py +11 -3
  278. data/tracks/python/exercises/house/house.py +1 -5
  279. data/tracks/python/exercises/house/house_test.py +269 -116
  280. data/tracks/python/exercises/list-ops/list_ops_test.py +1 -1
  281. data/tracks/python/exercises/luhn/luhn.py +3 -0
  282. data/tracks/python/exercises/luhn/luhn_test.py +1 -1
  283. data/tracks/python/exercises/markdown/markdown_test.py +2 -3
  284. data/tracks/python/exercises/minesweeper/minesweeper_test.py +1 -1
  285. data/tracks/python/exercises/nth-prime/nth_prime_test.py +1 -1
  286. data/tracks/python/exercises/ocr-numbers/ocr_numbers_test.py +1 -1
  287. data/tracks/python/exercises/palindrome-products/palindrome_products_test.py +14 -6
  288. data/tracks/python/exercises/perfect-numbers/perfect_numbers_test.py +1 -24
  289. data/tracks/python/exercises/phone-number/phone_number_test.py +11 -3
  290. data/tracks/python/exercises/poker/example.py +4 -3
  291. data/tracks/python/exercises/poker/poker.py +1 -1
  292. data/tracks/python/exercises/poker/poker_test.py +196 -119
  293. data/tracks/python/exercises/pov/example.py +3 -3
  294. data/tracks/python/exercises/pov/pov.py +2 -2
  295. data/tracks/python/exercises/pov/pov_test.py +19 -18
  296. data/tracks/python/exercises/protein-translation/protein_translation_test.py +14 -24
  297. data/tracks/python/exercises/rail-fence-cipher/rail_fence_cipher_test.py +1 -1
  298. data/tracks/python/exercises/rational-numbers/README.md +59 -0
  299. data/tracks/python/exercises/rational-numbers/example.py +58 -0
  300. data/tracks/python/exercises/rational-numbers/rational_numbers.py +34 -0
  301. data/tracks/python/exercises/rational-numbers/rational_numbers_test.py +132 -0
  302. data/tracks/python/exercises/rectangles/rectangles_test.py +1 -1
  303. data/tracks/python/exercises/roman-numerals/roman_numerals_test.py +2 -1
  304. data/tracks/python/exercises/run-length-encoding/run_length_encoding_test.py +2 -2
  305. data/tracks/python/exercises/saddle-points/saddle_points_test.py +18 -18
  306. data/tracks/python/exercises/scale-generator/example.py +4 -5
  307. data/tracks/python/exercises/scale-generator/scale_generator.py +2 -2
  308. data/tracks/python/exercises/scale-generator/scale_generator_test.py +38 -73
  309. data/tracks/python/exercises/secret-handshake/secret_handshake_test.py +1 -1
  310. data/tracks/python/exercises/tournament/tournament_test.py +1 -1
  311. data/tracks/python/exercises/twelve-days/example.py +3 -8
  312. data/tracks/python/exercises/twelve-days/twelve_days.py +1 -9
  313. data/tracks/python/exercises/twelve-days/twelve_days_test.py +51 -50
  314. data/tracks/python/exercises/two-bucket/example.py +3 -4
  315. data/tracks/python/exercises/two-bucket/two_bucket.py +1 -1
  316. data/tracks/python/exercises/two-bucket/two_bucket_test.py +8 -13
  317. data/tracks/python/exercises/two-fer/two_fer_test.py +8 -9
  318. data/tracks/python/exercises/variable-length-quantity/variable_length_quantity_test.py +1 -1
  319. data/tracks/python/exercises/word-count/word_count_test.py +8 -14
  320. data/tracks/python/exercises/word-search/word_search.py +3 -15
  321. data/tracks/python/exercises/word-search/word_search_test.py +1 -1
  322. data/tracks/python/exercises/wordy/wordy_test.py +1 -1
  323. data/tracks/python/exercises/zebra-puzzle/example.py +11 -2
  324. data/tracks/python/exercises/zebra-puzzle/zebra_puzzle.py +5 -1
  325. data/tracks/python/exercises/zebra-puzzle/zebra_puzzle_test.py +8 -5
  326. data/tracks/python/exercises/zipper/zipper_test.py +24 -30
  327. data/tracks/scala/exercises/dominoes/src/test/scala/DominoesTest.scala +2 -2
  328. data/tracks/scala/exercises/flatten-array/src/test/scala/FlattenArrayTest.scala +1 -1
  329. data/tracks/scala/exercises/food-chain/example.scala +3 -3
  330. data/tracks/scala/exercises/food-chain/src/test/scala/FoodChainTest.scala +12 -12
  331. data/tracks/scala/exercises/forth/src/test/scala/ForthTest.scala +35 -10
  332. data/tracks/scala/exercises/gigasecond/src/test/scala/GigasecondTest.scala +2 -2
  333. data/tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala +4 -4
  334. data/tracks/scala/exercises/hello-world/src/test/scala/HelloWorldTest.scala +2 -3
  335. data/tracks/scala/exercises/house/example.scala +4 -5
  336. data/tracks/scala/exercises/house/src/test/scala/HouseTest.scala +16 -17
  337. data/tracks/scala/exercises/isogram/src/test/scala/IsogramTest.scala +3 -3
  338. data/tracks/scala/exercises/kindergarten-garden/src/test/scala/GardenTest.scala +1 -29
  339. data/tracks/scala/exercises/largest-series-product/src/test/scala/SeriesTest.scala +20 -17
  340. data/tracks/scala/exercises/leap/src/test/scala/LeapTest.scala +3 -3
  341. data/tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala +3 -3
  342. data/tracks/scala/exercises/matrix/example.scala +5 -1
  343. data/tracks/scala/exercises/matrix/src/test/scala/MatrixTest.scala +48 -12
  344. data/tracks/scala/exercises/meetup/src/test/scala/MeetupTest.scala +2 -1
  345. data/tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala +9 -9
  346. data/tracks/scala/testgen/src/main/scala/DominoesTestGenerator.scala +6 -6
  347. data/tracks/scala/testgen/src/main/scala/FlattenArrayTestGenerator.scala +6 -6
  348. data/tracks/scala/testgen/src/main/scala/FoodChainTestGenerator.scala +10 -12
  349. data/tracks/scala/testgen/src/main/scala/ForthTestGenerator.scala +6 -6
  350. data/tracks/scala/testgen/src/main/scala/GigasecondTestGenerator.scala +6 -4
  351. data/tracks/scala/testgen/src/main/scala/HammingTestGenerator.scala +3 -3
  352. data/tracks/scala/testgen/src/main/scala/HouseTestGenerator.scala +10 -16
  353. data/tracks/scala/testgen/src/main/scala/IsogramTestGenerator.scala +1 -1
  354. data/tracks/scala/testgen/src/main/scala/KindergartenGardenTestGenerator.scala +6 -5
  355. data/tracks/scala/testgen/src/main/scala/LeapTestGenerator.scala +3 -3
  356. data/tracks/scala/testgen/src/main/scala/LuhnTestGenerator.scala +1 -1
  357. data/tracks/scala/testgen/src/main/scala/MatrixTestGenerator.scala +35 -0
  358. data/tracks/scala/testgen/src/main/scala/MeetupTestGenerator.scala +14 -11
  359. data/tracks/scala/testgen/src/main/scala/MinesweeperTestGenerator.scala +1 -1
  360. data/tracks/scala/testgen/src/main/scala/SeriesTestGenerator.scala +3 -3
  361. data/tracks/typescript/config/exercise_readme.go.tmpl +25 -4
  362. data/tracks/typescript/exercises/acronym/README.md +7 -2
  363. data/tracks/typescript/exercises/atbash-cipher/README.md +2 -1
  364. data/tracks/typescript/exercises/beer-song/README.md +2 -2
  365. data/tracks/typescript/exercises/binary-search-tree/README.md +2 -0
  366. data/tracks/typescript/exercises/circular-buffer/README.md +16 -7
  367. data/tracks/typescript/exercises/clock/README.md +6 -0
  368. data/tracks/typescript/exercises/diamond/README.md +8 -7
  369. data/tracks/typescript/exercises/etl/README.md +3 -1
  370. data/tracks/typescript/exercises/food-chain/README.md +1 -1
  371. data/tracks/typescript/exercises/grade-school/README.md +0 -1
  372. data/tracks/typescript/exercises/hello-world/.meta/hints.md +378 -0
  373. data/tracks/typescript/exercises/hello-world/README.md +37 -11
  374. data/tracks/typescript/exercises/largest-series-product/README.md +1 -6
  375. data/tracks/typescript/exercises/leap/README.md +1 -1
  376. data/tracks/typescript/exercises/linked-list/README.md +20 -15
  377. data/tracks/typescript/exercises/nth-prime/README.md +7 -2
  378. data/tracks/typescript/exercises/ocr-numbers/README.md +7 -6
  379. data/tracks/typescript/exercises/pangram/README.md +1 -1
  380. data/tracks/typescript/exercises/pascals-triangle/README.md +1 -1
  381. data/tracks/typescript/exercises/phone-number/README.md +4 -3
  382. data/tracks/typescript/exercises/prime-factors/README.md +1 -12
  383. data/tracks/typescript/exercises/pythagorean-triplet/README.md +3 -7
  384. data/tracks/typescript/exercises/rna-transcription/README.md +2 -2
  385. data/tracks/typescript/exercises/robot-simulator/README.md +3 -1
  386. data/tracks/typescript/exercises/scrabble-score/README.md +3 -1
  387. data/tracks/typescript/exercises/series/README.md +0 -4
  388. data/tracks/typescript/exercises/space-age/README.md +1 -1
  389. data/tracks/typescript/exercises/strain/README.md +6 -0
  390. data/tracks/typescript/exercises/sum-of-multiples/README.md +4 -7
  391. data/tracks/typescript/exercises/two-bucket/README.md +15 -19
  392. data/tracks/typescript/exercises/word-count/README.md +1 -2
  393. data/tracks/typescript/exercises/wordy/README.md +0 -5
  394. metadata +61 -5
  395. data/tracks/common-lisp/exercises/bob/.meta/description.md +0 -10
  396. data/tracks/javascript/.eslintrc.json +0 -10
  397. data/tracks/typescript/docs/EXERCISE_README_INSERT.md +0 -24
@@ -1,17 +1,5 @@
1
1
  class PhoneNumber {
2
-
3
- String areaCode, exchange, subscriber
4
-
5
- public PhoneNumber(String input) {
6
- throw new UnsupportedOperationException('Constructor implementation is missing')
2
+ PhoneNumber(String input) {
3
+ throw new UnsupportedOperationException('Constructor not implemented')
7
4
  }
8
-
9
- String getNumber() {
10
- throw new UnsupportedOperationException('Method implementation is missing')
11
- }
12
-
13
- String toString() {
14
- throw new UnsupportedOperationException('Method implementation is missing')
15
- }
16
-
17
5
  }
@@ -2,74 +2,87 @@
2
2
  import spock.lang.*
3
3
 
4
4
  class PhoneNumberSpec extends Specification {
5
+ def 'cleans the number'() {
6
+ expect: new PhoneNumber('(223) 456-7890').number == '2234567890'
7
+ }
5
8
 
6
- def 'a phone number is valid'() {
7
- expect: new PhoneNumber('(123) 456-7890').number == '1234567890'
9
+ @Ignore
10
+ def 'cleans numbers with dots'() {
11
+ expect: new PhoneNumber('223.456.7890').number == '2234567890'
8
12
  }
9
13
 
10
14
  @Ignore
11
- def 'a different phone number is valid'() {
12
- expect: new PhoneNumber('(987) 654-3210').number == '9876543210'
15
+ def 'cleans numbers with multiple spaces'() {
16
+ expect: new PhoneNumber('223 456 7890 ').number == '2234567890'
13
17
  }
14
18
 
15
19
  @Ignore
16
- def 'a phone nubmer separated by dots is valid'() {
17
- expect: new PhoneNumber('456.123.7890').number == '4561237890'
20
+ def 'invalid when 9 digits'() {
21
+ expect: new PhoneNumber('123456789').number == '0000000000'
18
22
  }
19
23
 
20
24
  @Ignore
21
- def 'a letter-containing phone number is invalid'() {
22
- expect: new PhoneNumber('123-abc-1234').number == '0000000000'
25
+ def 'invalid when 11 digits does not start with a 1'() {
26
+ expect: new PhoneNumber('22234567890').number == '0000000000'
23
27
  }
24
28
 
25
29
  @Ignore
26
- def 'a 9-digit number is invalid'() {
27
- expect: new PhoneNumber('123456789').number == '0000000000'
30
+ def 'valid when 11 digits and starting with 1'() {
31
+ expect: new PhoneNumber('12234567890').number == '2234567890'
28
32
  }
29
33
 
30
34
  @Ignore
31
- def 'an 11-digit number starting with a 1 is valid'() {
32
- expect: new PhoneNumber('19876543210').number == '9876543210'
35
+ def 'valid when 11 digits and starting with 1 even with punctuation'() {
36
+ expect: new PhoneNumber('+1 (223) 456-7890').number == '2234567890'
33
37
  }
34
38
 
35
39
  @Ignore
36
- def 'a 10-digit number, with an area code starting with 1, is valid'() {
37
- expect: new PhoneNumber('1234567890').number == '1234567890'
40
+ def 'invalid when more than 11 digits'() {
41
+ expect: new PhoneNumber('321234567890').number == '0000000000'
38
42
  }
39
43
 
40
44
  @Ignore
41
- def 'an 11-digit number, not beginning with a 1, is invalid'(){
42
- expect: new PhoneNumber('21234567890').number == '0000000000'
45
+ def 'invalid with letters'() {
46
+ expect: new PhoneNumber('123-abc-7890').number == '0000000000'
43
47
  }
44
48
 
45
49
  @Ignore
46
- def 'a 12-digit number, even one beginning with a 1, is invalid'(){
47
- expect: new PhoneNumber('112345678901').number == '0000000000'
50
+ def 'invalid with punctuations'() {
51
+ expect: new PhoneNumber('123-@:!-7890').number == '0000000000'
48
52
  }
49
53
 
50
54
  @Ignore
51
- def 'a 10-digit number containing letters is inavlid'() {
52
- expect: new PhoneNumber('1a2a3a4a5a6a7a8a9a0a').number == '0000000000'
55
+ def 'invalid if area code starts with 0'() {
56
+ expect: new PhoneNumber('(023) 456-7890').number == '0000000000'
53
57
  }
54
58
 
55
59
  @Ignore
56
- def 'can extract area code from a phone number'() {
57
- expect: new PhoneNumber('1234567890').areaCode == '123'
60
+ def 'invalid if area code starts with 1'() {
61
+ expect: new PhoneNumber('(123) 456-7890').number == '0000000000'
58
62
  }
59
63
 
60
64
  @Ignore
61
- def 'can extract an area code from a different phone number'() {
65
+ def 'invalid if exchange code starts with 0'() {
66
+ expect: new PhoneNumber('(223) 056-7890').number == '0000000000'
67
+ }
68
+
69
+ @Ignore
70
+ def 'invalid if exchange code starts with 1'() {
71
+ expect: new PhoneNumber('(223) 156-7890').number == '0000000000'
72
+ }
73
+
74
+ @Ignore
75
+ def 'can extract an area code from a phone number'() {
62
76
  expect: new PhoneNumber('9876543210').areaCode == '987'
63
77
  }
64
78
 
65
79
  @Ignore
66
80
  def 'can pretty print a phone number'() {
67
- expect: new PhoneNumber('5551234567').toString() == '(555) 123-4567'
81
+ expect: new PhoneNumber('5552234567').toString() == '(555) 223-4567'
68
82
  }
69
83
 
70
84
  @Ignore
71
85
  def 'can pretty print a full U.S. phone number'() {
72
- expect: new PhoneNumber('11234567890').toString() == '(123) 456-7890'
86
+ expect: new PhoneNumber('12234567890').toString() == '(223) 456-7890'
73
87
  }
74
-
75
88
  }
@@ -13,7 +13,7 @@ The format is usually represented as
13
13
  ```
14
14
  where `N` is any digit from 2 through 9 and `X` is any digit from 0 through 9.
15
15
 
16
- Your task is to clean up differently formated telephone numbers by removing punctuation and the country code (1) if present.
16
+ Your task is to clean up differently formatted telephone numbers by removing punctuation and the country code (1) if present.
17
17
 
18
18
  For example, the inputs
19
19
  - `+1 (613)-995-0253`
@@ -1050,6 +1050,19 @@
1050
1050
  "unlocked_by": "saddle-points",
1051
1051
  "uuid": "97c8fcd4-85b6-41cb-9de2-b4e1b4951222"
1052
1052
  },
1053
+ {
1054
+ "core": false,
1055
+ "difficulty": 7,
1056
+ "slug": "zipper",
1057
+ "topics": [
1058
+ "integer",
1059
+ "nodes",
1060
+ "tree",
1061
+ "links"
1062
+ ],
1063
+ "unlocked_by": "linked-list",
1064
+ "uuid": "25d2c7a5-1ec8-464a-b3de-ad1b27464ef1"
1065
+ },
1053
1066
  {
1054
1067
  "core": false,
1055
1068
  "difficulty": 8,
@@ -25,6 +25,16 @@ enough.)
25
25
 
26
26
  Words are case-insensitive.
27
27
 
28
+ # Running the tests
29
+
30
+ You can run all the tests for an exercise by entering
31
+
32
+ ```sh
33
+ $ gradle test
34
+ ```
35
+
36
+ in your terminal.
37
+
28
38
  ## Submitting Incomplete Solutions
29
39
 
30
40
  It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.2.0
@@ -95,3 +95,4 @@ include 'two-fer'
95
95
  include 'word-count'
96
96
  include 'word-search'
97
97
  include 'wordy'
98
+ include 'zipper'
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.1.0
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.1.0
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.1.0
@@ -27,7 +27,7 @@ To conclude, the only valid moves are:
27
27
  - emptying one bucket and doing nothing to the other
28
28
  - filling one bucket and doing nothing to the other
29
29
 
30
- Written with <3 at [Fullstack Academy](http://www.fullstackacademy.com/) by [Lindsay](http://lindsaylevine.com).
30
+ Written with <3 at [Fullstack Academy](http://www.fullstackacademy.com/) by Lindsay Levine.
31
31
 
32
32
  # Running the tests
33
33
 
@@ -0,0 +1,199 @@
1
+ class Zipper {
2
+
3
+ private int value;
4
+ BinaryTree tree; // Only the root node will bind to the BinaryTree
5
+ Zipper up;
6
+ Zipper left;
7
+ Zipper right;
8
+
9
+ Zipper(int val) {
10
+ value = val;
11
+ tree = null;
12
+ up = null;
13
+ left = null;
14
+ right = null;
15
+ }
16
+
17
+ /**
18
+ * Get a zipper out of a rose tree, the focus is on the root node
19
+ */
20
+ Zipper fromTree() {
21
+ Zipper current = this;
22
+ while (current.up != null) {
23
+ current = current.up;
24
+ }
25
+ return current;
26
+ }
27
+
28
+ BinaryTree toTree() {
29
+ Zipper current = this;
30
+ while (current.up != null) {
31
+ current = current.up;
32
+ }
33
+ return current.tree;
34
+ }
35
+
36
+ int getValue() {
37
+ return value;
38
+ }
39
+
40
+ Zipper setLeft(Zipper leftChild) {
41
+ left = leftChild;
42
+ if (leftChild != null) {
43
+ leftChild.up = this;
44
+ leftChild.tree = null;
45
+ }
46
+ return this;
47
+ }
48
+
49
+ Zipper setRight(Zipper rightChild) {
50
+ right = rightChild;
51
+ if (rightChild != null) {
52
+ rightChild.up = this;
53
+ rightChild.tree = null;
54
+ }
55
+ return this;
56
+ }
57
+
58
+ /**
59
+ * Move the focus to the previous child of the same parent
60
+ * @return a new Zipper
61
+ * Conditions: 1. The current Zipper must have a parent, i.e. it is not the root node.
62
+ * 2. The current Zipper must be the right child of its parent
63
+ */
64
+ Zipper getPrev() {
65
+ Zipper current = this;
66
+ try {
67
+ current = this.up;
68
+ current = current.left;
69
+ return current;
70
+ } catch (Exception e) {
71
+ System.out.println(e);
72
+ }
73
+ return null;
74
+ }
75
+
76
+ /**
77
+ * Move the focus to the next child of the same parent
78
+ * @return a new Zipper
79
+ * Conditions: 1. The current Zipper must have a parent, i.e. it is not the root node.
80
+ * 2. The current Zipper must be the left child of its parent
81
+ */
82
+ Zipper getNext() {
83
+ Zipper current = this;
84
+ try {
85
+ current = this.up;
86
+ current = current.right;
87
+ return current;
88
+ } catch (Exception e) {
89
+ System.out.println(e);
90
+ }
91
+ return null;
92
+ }
93
+
94
+ /**
95
+ * Move the focus to the parent
96
+ * @return a new Zipper
97
+ */
98
+ Zipper getUp() {
99
+ return up;
100
+ }
101
+
102
+ /**
103
+ * Set the value of the focus node, returns a new zipper
104
+ * @param val
105
+ */
106
+ void setValue(int val) {
107
+ this.value = val;
108
+ }
109
+
110
+ /**
111
+ * Insert a new subtree before the focus node, it becomes the prev of the focus node
112
+ * @return a new Zipper
113
+ */
114
+ Zipper insertBefore(Zipper toTheLeft) {
115
+ this.left = toTheLeft;
116
+ return this.left;
117
+ }
118
+
119
+ /**
120
+ * Insert a new subtree after the focus node, it becomes the next of the focus node
121
+ * @return a new Zipper
122
+ */
123
+ Zipper insertAfter(Zipper toTheRight) {
124
+ this.right = toTheRight;
125
+ return this.right;
126
+ }
127
+
128
+ /**
129
+ * Removes the focus node and all subtrees
130
+ * Focus moves to the next node if possible otherwise to the prev node if possible, otherwise to the parent node
131
+ * @return a new zipper
132
+ */
133
+ Zipper delete() {
134
+ Zipper current = this;
135
+ if (current.up == null) {
136
+ current = null;
137
+ } else {
138
+ if (current.up.left == current) {
139
+ current = current.up;
140
+ current.left = null;
141
+ if (current.right != null) {
142
+ current = current.right;
143
+ }
144
+ } else {
145
+ current = current.up;
146
+ current.right = null;
147
+ if (current.left != null) {
148
+ current = current.left;
149
+ }
150
+ }
151
+ }
152
+ return current;
153
+ }
154
+
155
+ }
156
+
157
+ class BinaryTree {
158
+
159
+ private Zipper root;
160
+
161
+ BinaryTree(int value) {
162
+ root = new Zipper(value);
163
+ root.tree = this;
164
+ }
165
+
166
+ BinaryTree(Zipper root) {
167
+ this.root = root;
168
+ this.root.tree = this;
169
+ }
170
+
171
+ Zipper getRoot() {
172
+ return root;
173
+ }
174
+
175
+ void setRoot(Zipper zipper) {
176
+ root = zipper;
177
+ root.tree = this;
178
+ }
179
+
180
+ String printTree(Zipper zipper) {
181
+ String str = "";
182
+ if (zipper.left == null && zipper.right == null) {
183
+ str += "value: " + zipper.getValue() + ", left: " + null + ", right: " + null;
184
+ } else if (zipper.left == null) {
185
+ str += "value: " + zipper.getValue() + ", left: " + null + ", right: { " + printTree(zipper.right) + " }";
186
+ } else if (zipper.right == null) {
187
+ str += "value: " + zipper.getValue() + ", left: { " + printTree(zipper.left) + " }, right: " + null;
188
+ } else {
189
+ str += "value: " + zipper.getValue() +
190
+ ", left: { " + printTree(zipper.left) + " }, right: { " + printTree(zipper.right) + " }";
191
+ }
192
+ return str;
193
+ }
194
+
195
+ String printTree() {
196
+ return printTree(root);
197
+ }
198
+
199
+ }
@@ -0,0 +1 @@
1
+ 1.1.0
@@ -0,0 +1,42 @@
1
+ # Zipper
2
+
3
+ Creating a zipper for a binary tree.
4
+
5
+ [Zippers](https://en.wikipedia.org/wiki/Zipper_%28data_structure%29) are
6
+ a purely functional way of navigating within a data structure and
7
+ manipulating it. They essentially contain a data structure and a
8
+ pointer into that data structure (called the focus).
9
+
10
+ For example given a rose tree (where each node contains a value and a
11
+ list of child nodes) a zipper might support these operations:
12
+
13
+ - `from_tree` (get a zipper out of a rose tree, the focus is on the root node)
14
+ - `to_tree` (get the rose tree out of the zipper)
15
+ - `value` (get the value of the focus node)
16
+ - `prev` (move the focus to the previous child of the same parent,
17
+ returns a new zipper)
18
+ - `next` (move the focus to the next child of the same parent, returns a
19
+ new zipper)
20
+ - `up` (move the focus to the parent, returns a new zipper)
21
+ - `set_value` (set the value of the focus node, returns a new zipper)
22
+ - `insert_before` (insert a new subtree before the focus node, it
23
+ becomes the `prev` of the focus node, returns a new zipper)
24
+ - `insert_after` (insert a new subtree after the focus node, it becomes
25
+ the `next` of the focus node, returns a new zipper)
26
+ - `delete` (removes the focus node and all subtrees, focus moves to the
27
+ `next` node if possible otherwise to the `prev` node if possible,
28
+ otherwise to the parent node, returns a new zipper)
29
+
30
+ # Running the tests
31
+
32
+ You can run all the tests for an exercise by entering
33
+
34
+ ```sh
35
+ $ gradle test
36
+ ```
37
+
38
+ in your terminal.
39
+
40
+ ## Submitting Incomplete Solutions
41
+
42
+ It's possible to submit an incomplete solution so you can see how others have completed the exercise.