trackler 2.2.1.151 → 2.2.1.152

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/exercises/hamming/description.md +4 -3
  4. data/problem-specifications/exercises/isbn-verifier/canonical-data.json +9 -1
  5. data/tracks/clojure/exercises/bob/README.md +2 -0
  6. data/tracks/clojure/exercises/bob/src/example.clj +4 -0
  7. data/tracks/clojure/exercises/bob/test/bob_test.clj +1 -1
  8. data/tracks/clojure/exercises/say/README.md +2 -1
  9. data/tracks/csharp/exercises/acronym/AcronymTest.cs +3 -9
  10. data/tracks/csharp/exercises/all-your-base/AllYourBaseTest.cs +43 -43
  11. data/tracks/csharp/exercises/allergies/AllergiesTest.cs +1 -1
  12. data/tracks/csharp/exercises/alphametics/AlphameticsTest.cs +21 -1
  13. data/tracks/csharp/exercises/anagram/AnagramTest.cs +1 -35
  14. data/tracks/csharp/exercises/atbash-cipher/AtbashCipherTest.cs +1 -1
  15. data/tracks/csharp/exercises/beer-song/BeerSong.cs +1 -6
  16. data/tracks/csharp/exercises/beer-song/BeerSongTest.cs +20 -28
  17. data/tracks/csharp/exercises/beer-song/Example.cs +6 -6
  18. data/tracks/csharp/exercises/binary-search/BinarySearchTest.cs +1 -1
  19. data/tracks/csharp/exercises/bob/BobTest.cs +1 -1
  20. data/tracks/csharp/exercises/book-store/BookStoreTest.cs +1 -1
  21. data/tracks/csharp/exercises/bowling/BowlingTest.cs +47 -29
  22. data/tracks/csharp/exercises/bracket-push/BracketPushTest.cs +36 -29
  23. data/tracks/csharp/exercises/change/Change.cs +1 -1
  24. data/tracks/csharp/exercises/change/ChangeTest.cs +48 -21
  25. data/tracks/csharp/exercises/change/Example.cs +31 -18
  26. data/tracks/csharp/exercises/circular-buffer/CircularBuffer.cs +2 -2
  27. data/tracks/csharp/exercises/circular-buffer/CircularBufferTest.cs +88 -111
  28. data/tracks/csharp/exercises/circular-buffer/Example.cs +7 -7
  29. data/tracks/csharp/exercises/clock/ClockTest.cs +37 -37
  30. data/tracks/csharp/exercises/collatz-conjecture/CollatzConjectureTest.cs +1 -1
  31. data/tracks/csharp/exercises/complex-numbers/ComplexNumbersTest.cs +19 -10
  32. data/tracks/csharp/exercises/connect/ConnectTest.cs +1 -1
  33. data/tracks/csharp/exercises/crypto-square/CryptoSquareTest.cs +1 -1
  34. data/tracks/csharp/exercises/custom-set/.meta/hints.md +3 -3
  35. data/tracks/csharp/exercises/custom-set/CustomSet.cs +10 -49
  36. data/tracks/csharp/exercises/custom-set/CustomSetTest.cs +153 -157
  37. data/tracks/csharp/exercises/custom-set/Example.cs +26 -54
  38. data/tracks/csharp/exercises/difference-of-squares/DifferenceOfSquaresTest.cs +1 -1
  39. data/tracks/csharp/exercises/dominoes/DominoesTest.cs +25 -25
  40. data/tracks/csharp/exercises/etl/Etl.cs +1 -1
  41. data/tracks/csharp/exercises/etl/EtlTest.cs +4 -4
  42. data/tracks/csharp/exercises/etl/Example.cs +1 -1
  43. data/tracks/csharp/exercises/flatten-array/FlattenArrayTest.cs +13 -13
  44. data/tracks/csharp/exercises/food-chain/Example.cs +5 -0
  45. data/tracks/csharp/exercises/food-chain/FoodChain.cs +5 -0
  46. data/tracks/csharp/exercises/food-chain/FoodChainTest.cs +9 -9
  47. data/tracks/csharp/exercises/forth/Example.cs +28 -33
  48. data/tracks/csharp/exercises/forth/Forth.cs +1 -19
  49. data/tracks/csharp/exercises/forth/ForthTest.cs +215 -52
  50. data/tracks/csharp/exercises/gigasecond/GigasecondTest.cs +1 -1
  51. data/tracks/csharp/exercises/grains/GrainsTest.cs +1 -1
  52. data/tracks/csharp/exercises/grep/Example.cs +1 -1
  53. data/tracks/csharp/exercises/grep/Grep.cs +1 -1
  54. data/tracks/csharp/exercises/grep/GrepTest.cs +268 -237
  55. data/tracks/csharp/exercises/hamming/HammingTest.cs +1 -1
  56. data/tracks/csharp/exercises/hello-world/HelloWorldTest.cs +1 -1
  57. data/tracks/csharp/exercises/house/Example.cs +7 -2
  58. data/tracks/csharp/exercises/house/House.cs +5 -0
  59. data/tracks/csharp/exercises/house/HouseTest.cs +40 -223
  60. data/tracks/csharp/exercises/isbn-verifier/IsbnVerifierTest.cs +14 -2
  61. data/tracks/csharp/exercises/isogram/IsogramTest.cs +1 -1
  62. data/tracks/csharp/exercises/kindergarten-garden/KindergartenGardenTest.cs +1 -1
  63. data/tracks/csharp/exercises/largest-series-product/LargestSeriesProductTest.cs +1 -1
  64. data/tracks/csharp/exercises/leap/LeapTest.cs +1 -1
  65. data/tracks/csharp/exercises/luhn/LuhnTest.cs +1 -1
  66. data/tracks/csharp/exercises/markdown/MarkdownTest.cs +34 -27
  67. data/tracks/csharp/exercises/minesweeper/MinesweeperTest.cs +29 -34
  68. data/tracks/csharp/exercises/nth-prime/NthPrimeTest.cs +1 -1
  69. data/tracks/csharp/exercises/nucleotide-count/NucleotideCountTest.cs +1 -1
  70. data/tracks/csharp/exercises/ocr-numbers/OcrNumbersTest.cs +35 -35
  71. data/tracks/csharp/exercises/pangram/PangramTest.cs +1 -1
  72. data/tracks/csharp/exercises/pascals-triangle/PascalsTriangleTest.cs +1 -1
  73. data/tracks/csharp/exercises/perfect-numbers/PerfectNumbersTest.cs +1 -1
  74. data/tracks/csharp/exercises/phone-number/PhoneNumberTest.cs +17 -3
  75. data/tracks/csharp/exercises/pig-latin/PigLatinTest.cs +1 -1
  76. data/tracks/csharp/exercises/poker/PokerTest.cs +1 -1
  77. data/tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs +1 -1
  78. data/tracks/csharp/exercises/protein-translation/Example.cs +4 -4
  79. data/tracks/csharp/exercises/protein-translation/ProteinTranslation.cs +1 -1
  80. data/tracks/csharp/exercises/protein-translation/ProteinTranslationTest.cs +104 -45
  81. data/tracks/csharp/exercises/proverb/ProverbTest.cs +38 -6
  82. data/tracks/csharp/exercises/queen-attack/QueenAttackTest.cs +1 -1
  83. data/tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs +1 -1
  84. data/tracks/csharp/exercises/raindrops/RaindropsTest.cs +1 -1
  85. data/tracks/csharp/exercises/rectangles/RectanglesTest.cs +63 -21
  86. data/tracks/csharp/exercises/reverse-string/ReverseStringTest.cs +1 -1
  87. data/tracks/csharp/exercises/rna-transcription/RnaTranscriptionTest.cs +1 -1
  88. data/tracks/csharp/exercises/roman-numerals/RomanNumeralsTest.cs +7 -1
  89. data/tracks/csharp/exercises/rotational-cipher/RotationalCipherTest.cs +1 -1
  90. data/tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs +1 -1
  91. data/tracks/csharp/exercises/saddle-points/SaddlePointsTest.cs +11 -11
  92. data/tracks/csharp/exercises/say/SayTest.cs +1 -1
  93. data/tracks/csharp/exercises/scale-generator/Example.cs +5 -0
  94. data/tracks/csharp/exercises/scale-generator/ScaleGenerator.cs +5 -0
  95. data/tracks/csharp/exercises/scale-generator/ScaleGeneratorTest.cs +56 -47
  96. data/tracks/csharp/exercises/scrabble-score/ScrabbleScoreTest.cs +1 -1
  97. data/tracks/csharp/exercises/secret-handshake/SecretHandshakeTest.cs +1 -1
  98. data/tracks/csharp/exercises/sieve/SieveTest.cs +1 -1
  99. data/tracks/csharp/exercises/space-age/SpaceAgeTest.cs +1 -1
  100. data/tracks/csharp/exercises/spiral-matrix/SpiralMatrixTest.cs +28 -34
  101. data/tracks/csharp/exercises/sum-of-multiples/SumOfMultiplesTest.cs +1 -1
  102. data/tracks/csharp/exercises/tournament/Example.cs +15 -7
  103. data/tracks/csharp/exercises/tournament/TournamentTest.cs +97 -99
  104. data/tracks/csharp/exercises/transpose/TransposeTest.cs +50 -96
  105. data/tracks/csharp/exercises/triangle/TriangleTest.cs +1 -1
  106. data/tracks/csharp/exercises/twelve-days/TwelveDays.cs +1 -1
  107. data/tracks/csharp/exercises/two-bucket/TwoBucketTest.cs +1 -1
  108. data/tracks/csharp/exercises/two-fer/TwoFerTest.cs +1 -1
  109. data/tracks/csharp/exercises/variable-length-quantity/Example.cs +3 -3
  110. data/tracks/csharp/exercises/variable-length-quantity/VariableLengthQuantity.cs +2 -2
  111. data/tracks/csharp/exercises/variable-length-quantity/VariableLengthQuantityTest.cs +165 -40
  112. data/tracks/csharp/exercises/word-count/Example.cs +1 -1
  113. data/tracks/csharp/exercises/word-count/WordCount.cs +1 -1
  114. data/tracks/csharp/exercises/word-count/WordCountTest.cs +12 -12
  115. data/tracks/csharp/exercises/wordy/WordyTest.cs +1 -1
  116. data/tracks/csharp/exercises/yacht/Example.cs +2 -5
  117. data/tracks/csharp/exercises/yacht/YachtTest.cs +7 -1
  118. data/tracks/csharp/exercises/zebra-puzzle/Example.cs +4 -4
  119. data/tracks/csharp/exercises/zebra-puzzle/ZebraPuzzle.cs +2 -2
  120. data/tracks/csharp/exercises/zebra-puzzle/ZebraPuzzleTest.cs +7 -5
  121. data/tracks/csharp/generators/Exercises/AllYourBase.cs +1 -0
  122. data/tracks/csharp/generators/Exercises/Alphametics.cs +5 -2
  123. data/tracks/csharp/generators/Exercises/BeerSong.cs +3 -0
  124. data/tracks/csharp/generators/Exercises/BinarySearch.cs +1 -0
  125. data/tracks/csharp/generators/Exercises/BookStore.cs +2 -0
  126. data/tracks/csharp/generators/Exercises/Bowling.cs +20 -15
  127. data/tracks/csharp/generators/Exercises/BracketPush.cs +1 -1
  128. data/tracks/csharp/generators/Exercises/Change.cs +20 -0
  129. data/tracks/csharp/generators/Exercises/CircularBuffer.cs +74 -0
  130. data/tracks/csharp/generators/Exercises/Clock.cs +7 -8
  131. data/tracks/csharp/generators/Exercises/ComplexNumbers.cs +9 -16
  132. data/tracks/csharp/generators/Exercises/Connect.cs +6 -6
  133. data/tracks/csharp/generators/Exercises/CustomSet.cs +56 -0
  134. data/tracks/csharp/generators/Exercises/Dominoes.cs +2 -2
  135. data/tracks/csharp/generators/Exercises/Etl.cs +7 -35
  136. data/tracks/csharp/generators/Exercises/FlattenArray.cs +9 -13
  137. data/tracks/csharp/generators/Exercises/FoodChain.cs +5 -0
  138. data/tracks/csharp/generators/Exercises/Forth.cs +25 -0
  139. data/tracks/csharp/generators/Exercises/Gigasecond.cs +4 -4
  140. data/tracks/csharp/generators/Exercises/Grains.cs +1 -1
  141. data/tracks/csharp/generators/Exercises/Grep.cs +106 -0
  142. data/tracks/csharp/generators/Exercises/Hamming.cs +1 -1
  143. data/tracks/csharp/generators/Exercises/House.cs +5 -0
  144. data/tracks/csharp/generators/Exercises/KindergartenGarden.cs +3 -3
  145. data/tracks/csharp/generators/Exercises/Markdown.cs +25 -0
  146. data/tracks/csharp/generators/Exercises/Meetup.cs +6 -6
  147. data/tracks/csharp/generators/Exercises/Minesweeper.cs +14 -4
  148. data/tracks/csharp/generators/Exercises/OcrNumbers.cs +12 -3
  149. data/tracks/csharp/generators/Exercises/PascalsTriangle.cs +0 -7
  150. data/tracks/csharp/generators/Exercises/ProteinTranslation.cs +8 -0
  151. data/tracks/csharp/generators/Exercises/Proverb.cs +7 -5
  152. data/tracks/csharp/generators/Exercises/QueenAttack.cs +3 -3
  153. data/tracks/csharp/generators/Exercises/Rectangles.cs +17 -0
  154. data/tracks/csharp/generators/Exercises/RobotSimulator.cs +6 -6
  155. data/tracks/csharp/generators/Exercises/SaddlePoints.cs +2 -2
  156. data/tracks/csharp/generators/Exercises/Say.cs +1 -1
  157. data/tracks/csharp/generators/Exercises/ScaleGenerator.cs +15 -0
  158. data/tracks/csharp/generators/Exercises/SpiralMatrix.cs +45 -0
  159. data/tracks/csharp/generators/Exercises/Sublist.cs +4 -5
  160. data/tracks/csharp/generators/Exercises/SumOfMultiples.cs +10 -1
  161. data/tracks/csharp/generators/Exercises/Tournament.cs +11 -19
  162. data/tracks/csharp/generators/Exercises/Transpose.cs +2 -2
  163. data/tracks/csharp/generators/Exercises/Triangle.cs +1 -3
  164. data/tracks/csharp/generators/Exercises/TwelveDays.cs +3 -4
  165. data/tracks/csharp/generators/Exercises/TwoBucket.cs +5 -5
  166. data/tracks/csharp/generators/Exercises/TwoFer.cs +11 -2
  167. data/tracks/csharp/generators/Exercises/VariableLengthQuantity.cs +44 -0
  168. data/tracks/csharp/generators/Exercises/Yacht.cs +11 -10
  169. data/tracks/csharp/generators/Exercises/ZebraPuzzle.cs +19 -0
  170. data/tracks/csharp/generators/GeneratorExercise.cs +6 -6
  171. data/tracks/csharp/generators/Input/CanonicalData.cs +6 -9
  172. data/tracks/csharp/generators/Input/CanonicalDataCase.cs +13 -46
  173. data/tracks/csharp/generators/Input/CanonicalDataCaseParser.cs +170 -0
  174. data/tracks/csharp/generators/Input/CanonicalDataFile.cs +1 -2
  175. data/tracks/csharp/generators/Input/CanonicalDataParser.cs +16 -12
  176. data/tracks/csharp/generators/Input/ConfigFile.cs +0 -5
  177. data/tracks/csharp/generators/Input/ConvertHelper.cs +20 -0
  178. data/tracks/csharp/generators/Output/Templates/_TestClassDisposable.liquid +14 -0
  179. data/tracks/csharp/generators/Output/TestMethodBodyData.cs +11 -14
  180. data/tracks/csharp/generators/Output/ValueFormatter.cs +20 -7
  181. data/tracks/delphi/config.json +22 -0
  182. data/tracks/delphi/exercises/grade-school/GradeSchool.dpr +60 -0
  183. data/tracks/delphi/exercises/grade-school/README.md +62 -0
  184. data/tracks/delphi/exercises/grade-school/uGradeSchoolExample.pas +134 -0
  185. data/tracks/delphi/exercises/grade-school/uGradeSchoolTest.pas +150 -0
  186. data/tracks/delphi/exercises/hamming/README.md +4 -3
  187. data/tracks/delphi/exercises/proverb/Proverb.dpr +60 -0
  188. data/tracks/delphi/exercises/proverb/README.md +44 -0
  189. data/tracks/delphi/exercises/proverb/uProverbExample.pas +60 -0
  190. data/tracks/delphi/exercises/proverb/uProverbTests.pas +124 -0
  191. data/tracks/go/exercises/bracket-push/README.md +3 -2
  192. data/tracks/go/exercises/bracket-push/cases_test.go +7 -2
  193. data/tracks/go/exercises/isbn-verifier/cases_test.go +4 -3
  194. data/tracks/go/exercises/yacht/cases_test.go +8 -2
  195. data/tracks/java/exercises/armstrong-numbers/README.md +1 -1
  196. data/tracks/java/exercises/binary-search-tree/src/test/java/BinarySearchTreeTest.java +22 -22
  197. data/tracks/java/exercises/bracket-push/README.md +3 -2
  198. data/tracks/java/exercises/crypto-square/README.md +23 -19
  199. data/tracks/java/exercises/grade-school/src/test/java/SchoolTest.java +1 -1
  200. data/tracks/java/exercises/poker/.meta/{version.txt → version} +0 -0
  201. data/tracks/java/exercises/queen-attack/src/test/java/QueenAttackCalculatorTest.java +7 -7
  202. data/tracks/java/exercises/rail-fence-cipher/.meta/version +1 -0
  203. data/tracks/java/exercises/robot-simulator/src/test/java/RobotTest.java +45 -45
  204. data/tracks/nim/config.json +24 -0
  205. data/tracks/nim/exercises/armstrong-numbers/README.md +18 -0
  206. data/tracks/nim/exercises/armstrong-numbers/armstrong_number_test.nim +29 -0
  207. data/tracks/nim/exercises/armstrong-numbers/example.nim +11 -0
  208. data/tracks/nim/exercises/leap/leap_test.nim +12 -10
  209. data/tracks/nim/exercises/two-fer/README.md +19 -0
  210. data/tracks/nim/exercises/two-fer/example.nim +3 -0
  211. data/tracks/nim/exercises/two-fer/two_fer_test.nim +16 -0
  212. data/tracks/python/.travis.yml +0 -1
  213. data/tracks/python/README.md +1 -1
  214. data/tracks/python/config/exercise_readme.go.tmpl +1 -1
  215. data/tracks/python/docs/INSTALLATION.md +1 -1
  216. data/tracks/python/exercises/accumulate/README.md +1 -1
  217. data/tracks/python/exercises/acronym/README.md +1 -1
  218. data/tracks/python/exercises/all-your-base/README.md +1 -1
  219. data/tracks/python/exercises/allergies/README.md +1 -1
  220. data/tracks/python/exercises/alphametics/README.md +1 -1
  221. data/tracks/python/exercises/anagram/README.md +1 -1
  222. data/tracks/python/exercises/armstrong-numbers/README.md +2 -2
  223. data/tracks/python/exercises/atbash-cipher/README.md +1 -1
  224. data/tracks/python/exercises/bank-account/README.md +1 -1
  225. data/tracks/python/exercises/beer-song/README.md +1 -1
  226. data/tracks/python/exercises/binary-search-tree/README.md +1 -1
  227. data/tracks/python/exercises/binary-search/README.md +1 -1
  228. data/tracks/python/exercises/binary/README.md +1 -1
  229. data/tracks/python/exercises/bob/README.md +1 -1
  230. data/tracks/python/exercises/book-store/README.md +1 -1
  231. data/tracks/python/exercises/bowling/README.md +1 -1
  232. data/tracks/python/exercises/bracket-push/README.md +4 -3
  233. data/tracks/python/exercises/change/README.md +1 -1
  234. data/tracks/python/exercises/circular-buffer/README.md +1 -1
  235. data/tracks/python/exercises/clock/README.md +1 -1
  236. data/tracks/python/exercises/collatz-conjecture/README.md +1 -1
  237. data/tracks/python/exercises/complex-numbers/README.md +1 -1
  238. data/tracks/python/exercises/connect/README.md +1 -1
  239. data/tracks/python/exercises/crypto-square/README.md +1 -1
  240. data/tracks/python/exercises/custom-set/README.md +1 -1
  241. data/tracks/python/exercises/diamond/README.md +1 -1
  242. data/tracks/python/exercises/difference-of-squares/README.md +1 -1
  243. data/tracks/python/exercises/diffie-hellman/README.md +1 -1
  244. data/tracks/python/exercises/dominoes/README.md +1 -1
  245. data/tracks/python/exercises/dot-dsl/README.md +1 -1
  246. data/tracks/python/exercises/error-handling/README.md +1 -1
  247. data/tracks/python/exercises/etl/README.md +1 -1
  248. data/tracks/python/exercises/flatten-array/README.md +1 -1
  249. data/tracks/python/exercises/food-chain/README.md +1 -1
  250. data/tracks/python/exercises/forth/README.md +1 -1
  251. data/tracks/python/exercises/gigasecond/README.md +1 -1
  252. data/tracks/python/exercises/go-counting/README.md +1 -1
  253. data/tracks/python/exercises/grade-school/README.md +1 -1
  254. data/tracks/python/exercises/grains/README.md +1 -1
  255. data/tracks/python/exercises/grep/README.md +1 -1
  256. data/tracks/python/exercises/hamming/README.md +1 -1
  257. data/tracks/python/exercises/hello-world/README.md +1 -1
  258. data/tracks/python/exercises/hexadecimal/README.md +1 -1
  259. data/tracks/python/exercises/house/README.md +1 -1
  260. data/tracks/python/exercises/isbn-verifier/README.md +1 -1
  261. data/tracks/python/exercises/isogram/README.md +1 -1
  262. data/tracks/python/exercises/kindergarten-garden/README.md +1 -1
  263. data/tracks/python/exercises/largest-series-product/README.md +1 -1
  264. data/tracks/python/exercises/leap/README.md +1 -1
  265. data/tracks/python/exercises/linked-list/README.md +1 -1
  266. data/tracks/python/exercises/list-ops/README.md +1 -1
  267. data/tracks/python/exercises/luhn/README.md +1 -1
  268. data/tracks/python/exercises/markdown/README.md +1 -1
  269. data/tracks/python/exercises/matrix/README.md +1 -1
  270. data/tracks/python/exercises/meetup/README.md +1 -1
  271. data/tracks/python/exercises/minesweeper/README.md +1 -1
  272. data/tracks/python/exercises/nth-prime/README.md +1 -1
  273. data/tracks/python/exercises/nucleotide-count/README.md +1 -1
  274. data/tracks/python/exercises/ocr-numbers/README.md +1 -1
  275. data/tracks/python/exercises/octal/README.md +1 -1
  276. data/tracks/python/exercises/palindrome-products/README.md +1 -1
  277. data/tracks/python/exercises/pangram/README.md +1 -1
  278. data/tracks/python/exercises/parallel-letter-frequency/README.md +1 -1
  279. data/tracks/python/exercises/pascals-triangle/README.md +1 -1
  280. data/tracks/python/exercises/perfect-numbers/README.md +1 -1
  281. data/tracks/python/exercises/phone-number/README.md +1 -1
  282. data/tracks/python/exercises/pig-latin/README.md +1 -1
  283. data/tracks/python/exercises/point-mutations/README.md +1 -1
  284. data/tracks/python/exercises/poker/README.md +1 -1
  285. data/tracks/python/exercises/pov/README.md +1 -1
  286. data/tracks/python/exercises/prime-factors/README.md +1 -1
  287. data/tracks/python/exercises/protein-translation/README.md +1 -1
  288. data/tracks/python/exercises/proverb/README.md +1 -1
  289. data/tracks/python/exercises/pythagorean-triplet/README.md +1 -1
  290. data/tracks/python/exercises/queen-attack/README.md +1 -1
  291. data/tracks/python/exercises/rail-fence-cipher/README.md +1 -1
  292. data/tracks/python/exercises/raindrops/README.md +1 -1
  293. data/tracks/python/exercises/rational-numbers/README.md +1 -1
  294. data/tracks/python/exercises/react/README.md +1 -1
  295. data/tracks/python/exercises/rectangles/README.md +1 -1
  296. data/tracks/python/exercises/reverse-string/README.md +1 -1
  297. data/tracks/python/exercises/rna-transcription/README.md +1 -1
  298. data/tracks/python/exercises/robot-name/README.md +1 -1
  299. data/tracks/python/exercises/robot-simulator/README.md +1 -1
  300. data/tracks/python/exercises/roman-numerals/README.md +1 -1
  301. data/tracks/python/exercises/rotational-cipher/README.md +1 -1
  302. data/tracks/python/exercises/run-length-encoding/README.md +1 -1
  303. data/tracks/python/exercises/saddle-points/README.md +1 -1
  304. data/tracks/python/exercises/say/README.md +1 -1
  305. data/tracks/python/exercises/scale-generator/README.md +1 -1
  306. data/tracks/python/exercises/scrabble-score/README.md +1 -1
  307. data/tracks/python/exercises/secret-handshake/README.md +1 -1
  308. data/tracks/python/exercises/series/README.md +1 -1
  309. data/tracks/python/exercises/sgf-parsing/README.md +1 -1
  310. data/tracks/python/exercises/sieve/README.md +1 -1
  311. data/tracks/python/exercises/simple-cipher/README.md +1 -1
  312. data/tracks/python/exercises/simple-linked-list/README.md +1 -1
  313. data/tracks/python/exercises/space-age/README.md +1 -1
  314. data/tracks/python/exercises/spiral-matrix/README.md +1 -1
  315. data/tracks/python/exercises/strain/README.md +1 -1
  316. data/tracks/python/exercises/sublist/README.md +1 -1
  317. data/tracks/python/exercises/sum-of-multiples/README.md +1 -1
  318. data/tracks/python/exercises/tournament/README.md +1 -1
  319. data/tracks/python/exercises/transpose/README.md +1 -1
  320. data/tracks/python/exercises/tree-building/README.md +1 -1
  321. data/tracks/python/exercises/triangle/README.md +1 -1
  322. data/tracks/python/exercises/trinary/README.md +1 -1
  323. data/tracks/python/exercises/twelve-days/README.md +1 -1
  324. data/tracks/python/exercises/two-bucket/README.md +1 -1
  325. data/tracks/python/exercises/two-fer/README.md +1 -1
  326. data/tracks/python/exercises/variable-length-quantity/README.md +1 -1
  327. data/tracks/python/exercises/word-count/README.md +1 -1
  328. data/tracks/python/exercises/word-search/README.md +1 -1
  329. data/tracks/python/exercises/wordy/README.md +1 -1
  330. data/tracks/python/exercises/yacht/README.md +1 -1
  331. data/tracks/python/exercises/zebra-puzzle/README.md +1 -1
  332. data/tracks/python/exercises/zipper/README.md +1 -1
  333. data/tracks/python/requirements-travis.txt +1 -1
  334. data/tracks/swift/exercises/scale-generator/Tests/ScaleGeneratorTests/ScaleGeneratorTests.swift +1 -1
  335. metadata +32 -8
  336. data/tracks/csharp/generators/Input/CanonicalDataCaseJson.cs +0 -73
  337. data/tracks/csharp/generators/Input/CanonicalDataCaseJsonConverter.cs +0 -49
  338. data/tracks/csharp/generators/Input/CanonicalDataCasesJson.cs +0 -58
  339. data/tracks/csharp/generators/Input/CanonicalDataCasesJsonConverter.cs +0 -17
  340. data/tracks/java/exercises/go-counting/src/main/java/.keep +0 -0
@@ -2,7 +2,7 @@
2
2
 
3
3
  public static class Change
4
4
  {
5
- public static int[] Calculate(int target, int[] coins)
5
+ public static int[] FindFewestCoins(int[] coins, int target)
6
6
  {
7
7
  throw new NotImplementedException("You need to implement this function.");
8
8
  }
@@ -1,75 +1,102 @@
1
- using System;
1
+ // This file was auto-generated based on version 1.2.0 of the canonical data.
2
+
2
3
  using Xunit;
4
+ using System;
3
5
 
4
6
  public class ChangeTest
5
7
  {
6
8
  [Fact]
7
9
  public void Single_coin_change()
8
10
  {
9
- var actual = new[] { 1, 5, 10, 25, 100 };
11
+ var coins = new[] { 1, 5, 10, 25, 100 };
10
12
  var target = 25;
11
13
  var expected = new[] { 25 };
12
- Assert.Equal(expected, Change.Calculate(target, actual));
14
+ Assert.Equal(expected, Change.FindFewestCoins(coins, target));
13
15
  }
14
16
 
15
17
  [Fact(Skip = "Remove to run test")]
16
18
  public void Multiple_coin_change()
17
19
  {
18
- var actual = new[] { 1, 5, 10, 25, 100 };
20
+ var coins = new[] { 1, 5, 10, 25, 100 };
19
21
  var target = 15;
20
22
  var expected = new[] { 5, 10 };
21
- Assert.Equal(expected, Change.Calculate(target, actual));
23
+ Assert.Equal(expected, Change.FindFewestCoins(coins, target));
22
24
  }
23
25
 
24
26
  [Fact(Skip = "Remove to run test")]
25
- public void Change_with_Lilliputian_Coins()
27
+ public void Change_with_lilliputian_coins()
26
28
  {
27
- var actual = new[] { 1, 4, 15, 20, 50 };
29
+ var coins = new[] { 1, 4, 15, 20, 50 };
28
30
  var target = 23;
29
31
  var expected = new[] { 4, 4, 15 };
30
- Assert.Equal(expected, Change.Calculate(target, actual));
32
+ Assert.Equal(expected, Change.FindFewestCoins(coins, target));
31
33
  }
32
34
 
33
35
  [Fact(Skip = "Remove to run test")]
34
- public void Change_with_Lower_Elbonia_Coins()
36
+ public void Change_with_lower_elbonia_coins()
35
37
  {
36
- var actual = new[] { 1, 5, 10, 21, 25 };
38
+ var coins = new[] { 1, 5, 10, 21, 25 };
37
39
  var target = 63;
38
40
  var expected = new[] { 21, 21, 21 };
39
- Assert.Equal(expected, Change.Calculate(target, actual));
41
+ Assert.Equal(expected, Change.FindFewestCoins(coins, target));
40
42
  }
41
43
 
42
44
  [Fact(Skip = "Remove to run test")]
43
45
  public void Large_target_values()
44
46
  {
45
- var actual = new[] { 1, 2, 5, 10, 20, 50, 100 };
47
+ var coins = new[] { 1, 2, 5, 10, 20, 50, 100 };
46
48
  var target = 999;
47
49
  var expected = new[] { 2, 2, 5, 20, 20, 50, 100, 100, 100, 100, 100, 100, 100, 100, 100 };
48
- Assert.Equal(expected, Change.Calculate(target, actual));
50
+ Assert.Equal(expected, Change.FindFewestCoins(coins, target));
51
+ }
52
+
53
+ [Fact(Skip = "Remove to run test")]
54
+ public void Possible_change_without_unit_coins_available()
55
+ {
56
+ var coins = new[] { 2, 5, 10, 20, 50 };
57
+ var target = 21;
58
+ var expected = new[] { 2, 2, 2, 5, 10 };
59
+ Assert.Equal(expected, Change.FindFewestCoins(coins, target));
60
+ }
61
+
62
+ [Fact(Skip = "Remove to run test")]
63
+ public void Another_possible_change_without_unit_coins_available()
64
+ {
65
+ var coins = new[] { 4, 5 };
66
+ var target = 27;
67
+ var expected = new[] { 4, 4, 4, 5, 5, 5 };
68
+ Assert.Equal(expected, Change.FindFewestCoins(coins, target));
49
69
  }
50
70
 
51
71
  [Fact(Skip = "Remove to run test")]
52
72
  public void No_coins_make_0_change()
53
73
  {
54
- var actual = new[] { 1, 5, 10, 21, 25 };
74
+ var coins = new[] { 1, 5, 10, 21, 25 };
55
75
  var target = 0;
56
- var expected = new int[0];
57
- Assert.Equal(expected, Change.Calculate(target, actual));
76
+ Assert.Empty(Change.FindFewestCoins(coins, target));
58
77
  }
59
78
 
60
79
  [Fact(Skip = "Remove to run test")]
61
80
  public void Error_testing_for_change_smaller_than_the_smallest_of_coins()
62
81
  {
63
- var actual = new[] { 5, 10 };
82
+ var coins = new[] { 5, 10 };
64
83
  var target = 3;
65
- Assert.Throws<ArgumentException>(() => Change.Calculate(target, actual));
84
+ Assert.Throws<ArgumentException>(() => Change.FindFewestCoins(coins, target));
85
+ }
86
+
87
+ [Fact(Skip = "Remove to run test")]
88
+ public void Error_if_no_combination_can_add_up_to_target()
89
+ {
90
+ var coins = new[] { 5, 10 };
91
+ var target = 94;
92
+ Assert.Throws<ArgumentException>(() => Change.FindFewestCoins(coins, target));
66
93
  }
67
94
 
68
95
  [Fact(Skip = "Remove to run test")]
69
96
  public void Cannot_find_negative_change_values()
70
97
  {
71
- var actual = new[] { 1, 2, 5 };
98
+ var coins = new[] { 1, 2, 5 };
72
99
  var target = -5;
73
- Assert.Throws<ArgumentException>(() => Change.Calculate(target, actual));
100
+ Assert.Throws<ArgumentException>(() => Change.FindFewestCoins(coins, target));
74
101
  }
75
- }
102
+ }
@@ -1,9 +1,10 @@
1
1
  using System;
2
+ using System.Collections.Generic;
2
3
  using System.Linq;
3
4
 
4
5
  public static class Change
5
6
  {
6
- public static int[] Calculate(int target, int[] coins)
7
+ public static int[] FindFewestCoins(int[] coins, int target)
7
8
  {
8
9
  if (target < 0)
9
10
  {
@@ -14,26 +15,38 @@ public static int[] Calculate(int target, int[] coins)
14
15
  throw new ArgumentException("Target amount cannot be less than minimal coin value.");
15
16
  }
16
17
 
17
- var minimalCoins = new int[target + 1][];
18
- minimalCoins[0] = new int[0];
19
-
20
- for (var amount = 1; amount <= target; amount++)
18
+ var minimalCoinsMapSeed = new Dictionary<int, List<int>>
21
19
  {
22
- minimalCoins[amount] = coins.Where(c => c <= amount)
23
- .Select(c => Prepend(c, minimalCoins[amount - c]))
24
- .OrderBy(c => c.Length)
25
- .FirstOrDefault() ?? new int[0];
26
- }
20
+ [0] = new List<int>(0)
21
+ };
27
22
 
28
- return minimalCoins[target];
29
- }
23
+ var minimalCoinsMap = Enumerable.Range(1, target)
24
+ .Aggregate(minimalCoinsMapSeed, UpdateMinimalCoinsMap);
30
25
 
31
- private static int[] Prepend(int coin, int[] coins)
32
- {
33
- var newCoins = new int[coins.Length + 1];
34
- newCoins[0] = coin;
35
- Array.Copy(coins, 0, newCoins, 1, coins.Length);
26
+ if (minimalCoinsMap.TryGetValue(target, out var minimalCoins))
27
+ return minimalCoins.OrderBy(x => x).ToArray();
28
+
29
+ throw new ArgumentException();
30
+
31
+ Dictionary<int, List<int>> UpdateMinimalCoinsMap(Dictionary<int, List<int>> current, int subTarget)
32
+ {
33
+ var subTargetMinimalCoins = MinimalCoins(current, subTarget);
34
+ if (subTargetMinimalCoins != null)
35
+ current.Add(subTarget, subTargetMinimalCoins);
36
+
37
+ return current;
38
+ }
36
39
 
37
- return newCoins;
40
+ List<int> MinimalCoins(Dictionary<int, List<int>> current, int subTarget)
41
+ {
42
+ return coins
43
+ .Where(coin => coin <= subTarget)
44
+ .Select(coin => current.TryGetValue(subTarget - coin, out var subTargetMinimalCoins)
45
+ ? subTargetMinimalCoins.Append(coin).ToList()
46
+ : null)
47
+ .Where(subTargetMinimalCoins => subTargetMinimalCoins != null)
48
+ .OrderBy(subTargetMinimalCoins => subTargetMinimalCoins.Count)
49
+ .FirstOrDefault();
50
+ }
38
51
  }
39
52
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  public class CircularBuffer<T>
4
4
  {
5
- public CircularBuffer(int size)
5
+ public CircularBuffer(int capacity)
6
6
  {
7
7
  throw new NotImplementedException("You need to implement this function.");
8
8
  }
@@ -17,7 +17,7 @@ public void Write(T value)
17
17
  throw new NotImplementedException("You need to implement this function.");
18
18
  }
19
19
 
20
- public void ForceWrite(T value)
20
+ public void Overwrite(T value)
21
21
  {
22
22
  throw new NotImplementedException("You need to implement this function.");
23
23
  }
@@ -1,158 +1,135 @@
1
- using System;
1
+ // This file was auto-generated based on version 1.1.0 of the canonical data.
2
+
2
3
  using Xunit;
4
+ using System;
3
5
 
4
6
  public class CircularBufferTest
5
7
  {
6
8
  [Fact]
7
- public void Write_and_read_back_one_item()
9
+ public void Reading_empty_buffer_should_fail()
8
10
  {
9
- var buffer = new CircularBuffer<char>(1);
10
- buffer.Write('1');
11
- var val = buffer.Read();
12
-
13
- Assert.Equal('1', val);
11
+ var buffer = new CircularBuffer<int>(capacity: 1);
14
12
  Assert.Throws<InvalidOperationException>(() => buffer.Read());
15
13
  }
16
14
 
17
15
  [Fact(Skip = "Remove to run test")]
18
- public void Write_and_read_back_multiple_items()
16
+ public void Can_read_an_item_just_written()
19
17
  {
20
- var buffer = new CircularBuffer<char>(2);
21
- buffer.Write('1');
22
- buffer.Write('2');
23
-
24
- var val1 = buffer.Read();
25
- var val2 = buffer.Read();
26
-
27
- Assert.Equal('1', val1);
28
- Assert.Equal('2', val2);
29
- Assert.Throws<InvalidOperationException>(() => buffer.Read());
18
+ var buffer = new CircularBuffer<int>(capacity: 1);
19
+ buffer.Write(1);
20
+ Assert.Equal(1, buffer.Read());
30
21
  }
31
22
 
32
23
  [Fact(Skip = "Remove to run test")]
33
- public void Clearing_buffer()
24
+ public void Each_item_may_only_be_read_once()
34
25
  {
35
- var buffer = new CircularBuffer<char>(3);
36
- buffer.Write('1');
37
- buffer.Write('2');
38
- buffer.Write('3');
39
-
40
- buffer.Clear();
41
-
26
+ var buffer = new CircularBuffer<int>(capacity: 1);
27
+ buffer.Write(1);
28
+ Assert.Equal(1, buffer.Read());
42
29
  Assert.Throws<InvalidOperationException>(() => buffer.Read());
43
-
44
- buffer.Write('1');
45
- buffer.Write('2');
46
-
47
- var val1 = buffer.Read();
48
- buffer.Write('3');
49
- var val2 = buffer.Read();
50
-
51
- Assert.Equal('1', val1);
52
- Assert.Equal('2', val2);
53
30
  }
54
31
 
55
32
  [Fact(Skip = "Remove to run test")]
56
- public void Alternate_write_and_read()
33
+ public void Items_are_read_in_the_order_they_are_written()
57
34
  {
58
- var buffer = new CircularBuffer<char>(2);
59
- buffer.Write('1');
60
- var val1 = buffer.Read();
61
- buffer.Write('2');
62
- var val2 = buffer.Read();
63
-
64
- Assert.Equal('1', val1);
65
- Assert.Equal('2', val2);
35
+ var buffer = new CircularBuffer<int>(capacity: 2);
36
+ buffer.Write(1);
37
+ buffer.Write(2);
38
+ Assert.Equal(1, buffer.Read());
39
+ Assert.Equal(2, buffer.Read());
66
40
  }
67
41
 
68
42
  [Fact(Skip = "Remove to run test")]
69
- public void Reads_back_oldest_item()
43
+ public void Full_buffer_cant_be_written_to()
70
44
  {
71
- var buffer1 = new CircularBuffer<char>(3);
72
- buffer1.Write('1');
73
- buffer1.Write('2');
74
- var val1 = buffer1.Read();
75
-
76
- buffer1.Write('3');
77
- var val2 = buffer1.Read();
78
- var val3 = buffer1.Read();
79
- Assert.Equal('2', val2);
80
- Assert.Equal('3', val3);
45
+ var buffer = new CircularBuffer<int>(capacity: 1);
46
+ buffer.Write(1);
47
+ Assert.Throws<InvalidOperationException>(() => buffer.Write(2));
81
48
  }
82
49
 
83
50
  [Fact(Skip = "Remove to run test")]
84
- public void Writing_to_a_full_buffer_throws_an_exception()
51
+ public void A_read_frees_up_capacity_for_another_write()
85
52
  {
86
- var buffer = new CircularBuffer<char>(2);
87
- buffer.Write('1');
88
- buffer.Write('2');
89
-
90
- Assert.Throws<InvalidOperationException>(() => buffer.Write('A'));
53
+ var buffer = new CircularBuffer<int>(capacity: 1);
54
+ buffer.Write(1);
55
+ Assert.Equal(1, buffer.Read());
56
+ buffer.Write(2);
57
+ Assert.Equal(2, buffer.Read());
91
58
  }
92
59
 
93
60
  [Fact(Skip = "Remove to run test")]
94
- public void Overwriting_oldest_item_in_a_full_buffer()
61
+ public void Read_position_is_maintained_even_across_multiple_writes()
95
62
  {
96
- var buffer = new CircularBuffer<char>(2);
97
- buffer.Write('1');
98
- buffer.Write('2');
99
- buffer.ForceWrite('A');
100
-
101
- var val1 = buffer.Read();
102
- var val2 = buffer.Read();
103
-
104
- Assert.Equal('2', val1);
105
- Assert.Equal('A', val2);
106
- Assert.Throws<InvalidOperationException>(() => buffer.Read());
63
+ var buffer = new CircularBuffer<int>(capacity: 3);
64
+ buffer.Write(1);
65
+ buffer.Write(2);
66
+ Assert.Equal(1, buffer.Read());
67
+ buffer.Write(3);
68
+ Assert.Equal(2, buffer.Read());
69
+ Assert.Equal(3, buffer.Read());
107
70
  }
108
71
 
109
72
  [Fact(Skip = "Remove to run test")]
110
- public void Forced_writes_to_non_full_buffer_should_behave_like_writes()
73
+ public void Items_cleared_out_of_buffer_cant_be_read()
111
74
  {
112
- var buffer = new CircularBuffer<char>(2);
113
- buffer.Write('1');
114
- buffer.ForceWrite('2');
115
-
116
- var val1 = buffer.Read();
117
- var val2 = buffer.Read();
118
-
119
- Assert.Equal('1', val1);
120
- Assert.Equal('2', val2);
75
+ var buffer = new CircularBuffer<int>(capacity: 1);
76
+ buffer.Write(1);
77
+ buffer.Clear();
121
78
  Assert.Throws<InvalidOperationException>(() => buffer.Read());
122
79
  }
123
80
 
124
81
  [Fact(Skip = "Remove to run test")]
125
- public void Alternate_read_and_write_into_buffer_overflow()
82
+ public void Clear_frees_up_capacity_for_another_write()
126
83
  {
127
- var buffer = new CircularBuffer<char>(5);
128
- buffer.Write('1');
129
- buffer.Write('2');
130
- buffer.Write('3');
131
-
132
- var val1 = buffer.Read();
133
- var val2 = buffer.Read();
134
- buffer.Write('4');
135
- var val3 = buffer.Read();
84
+ var buffer = new CircularBuffer<int>(capacity: 1);
85
+ buffer.Write(1);
86
+ buffer.Clear();
87
+ buffer.Write(2);
88
+ Assert.Equal(2, buffer.Read());
89
+ }
136
90
 
137
- buffer.Write('5');
138
- buffer.Write('6');
139
- buffer.Write('7');
140
- buffer.Write('8');
91
+ [Fact(Skip = "Remove to run test")]
92
+ public void Clear_does_nothing_on_empty_buffer()
93
+ {
94
+ var buffer = new CircularBuffer<int>(capacity: 1);
95
+ buffer.Clear();
96
+ buffer.Write(1);
97
+ Assert.Equal(1, buffer.Read());
98
+ }
141
99
 
142
- buffer.ForceWrite('A');
143
- buffer.ForceWrite('B');
100
+ [Fact(Skip = "Remove to run test")]
101
+ public void Overwrite_acts_like_write_on_non_full_buffer()
102
+ {
103
+ var buffer = new CircularBuffer<int>(capacity: 2);
104
+ buffer.Write(1);
105
+ buffer.Overwrite(2);
106
+ Assert.Equal(1, buffer.Read());
107
+ Assert.Equal(2, buffer.Read());
108
+ }
144
109
 
145
- var val4 = buffer.Read();
146
- var val5 = buffer.Read();
147
- var val6 = buffer.Read();
148
- var val7 = buffer.Read();
149
- var val8 = buffer.Read();
110
+ [Fact(Skip = "Remove to run test")]
111
+ public void Overwrite_replaces_the_oldest_item_on_full_buffer()
112
+ {
113
+ var buffer = new CircularBuffer<int>(capacity: 2);
114
+ buffer.Write(1);
115
+ buffer.Write(2);
116
+ buffer.Overwrite(3);
117
+ Assert.Equal(2, buffer.Read());
118
+ Assert.Equal(3, buffer.Read());
119
+ }
150
120
 
151
- Assert.Equal('6', val4);
152
- Assert.Equal('7', val5);
153
- Assert.Equal('8', val6);
154
- Assert.Equal('A', val7);
155
- Assert.Equal('B', val8);
156
- Assert.Throws<InvalidOperationException>(() => buffer.Read());
121
+ [Fact(Skip = "Remove to run test")]
122
+ public void Overwrite_replaces_the_oldest_item_remaining_in_buffer_following_a_read()
123
+ {
124
+ var buffer = new CircularBuffer<int>(capacity: 3);
125
+ buffer.Write(1);
126
+ buffer.Write(2);
127
+ buffer.Write(3);
128
+ Assert.Equal(1, buffer.Read());
129
+ buffer.Write(4);
130
+ buffer.Overwrite(5);
131
+ Assert.Equal(3, buffer.Read());
132
+ Assert.Equal(4, buffer.Read());
133
+ Assert.Equal(5, buffer.Read());
157
134
  }
158
135
  }