trackler 2.2.1.99 → 2.2.1.100

Sign up to get free protection for your applications and to get access to all the features.
Files changed (296) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/exercises/clock/canonical-data.json +303 -204
  4. data/problem-specifications/exercises/complex-numbers/canonical-data.json +104 -44
  5. data/problem-specifications/exercises/matrix/canonical-data.json +78 -0
  6. data/problem-specifications/exercises/word-count/canonical-data.json +12 -12
  7. data/tracks/bash/config.json +128 -110
  8. data/tracks/c/exercises/word-count/test/test_word_count.c +2 -2
  9. data/tracks/dart/CONTRIBUTING.md +2 -2
  10. data/tracks/dart/docs/EXERCISE_README_INSERT.md +0 -1
  11. data/tracks/dart/docs/INSTALLATION.md +17 -11
  12. data/tracks/fsharp/exercises/acronym/AcronymTest.fs +3 -7
  13. data/tracks/fsharp/exercises/anagram/AnagramTest.fs +1 -21
  14. data/tracks/fsharp/exercises/book-store/BookStoreTest.fs +1 -1
  15. data/tracks/fsharp/exercises/complex-numbers/ComplexNumbersTest.fs +25 -25
  16. data/tracks/fsharp/exercises/custom-set/CustomSetTest.fs +1 -1
  17. data/tracks/fsharp/exercises/food-chain/FoodChainTest.fs +1 -1
  18. data/tracks/fsharp/exercises/gigasecond/GigasecondTest.fs +1 -1
  19. data/tracks/fsharp/exercises/hamming/HammingTest.fs +1 -1
  20. data/tracks/fsharp/exercises/hello-world/HelloWorldTest.fs +1 -1
  21. data/tracks/fsharp/exercises/largest-series-product/LargestSeriesProductTest.fs +1 -1
  22. data/tracks/fsharp/exercises/leap/LeapTest.fs +1 -1
  23. data/tracks/fsharp/exercises/markdown/MarkdownTest.fs +19 -19
  24. data/tracks/fsharp/exercises/minesweeper/MinesweeperTest.fs +27 -27
  25. data/tracks/fsharp/exercises/nth-prime/NthPrimeTest.fs +1 -1
  26. data/tracks/fsharp/exercises/nucleotide-count/NucleotideCountTest.fs +1 -1
  27. data/tracks/fsharp/exercises/pangram/PangramTest.fs +1 -1
  28. data/tracks/fsharp/exercises/pascals-triangle/PascalsTriangleTest.fs +1 -1
  29. data/tracks/fsharp/exercises/perfect-numbers/PerfectNumbersTest.fs +1 -1
  30. data/tracks/fsharp/exercises/phone-number/PhoneNumberTest.fs +11 -3
  31. data/tracks/fsharp/exercises/pig-latin/PigLatinTest.fs +1 -1
  32. data/tracks/fsharp/exercises/protein-translation/Example.fs +2 -2
  33. data/tracks/fsharp/exercises/protein-translation/ProteinTranslation.fs +1 -1
  34. data/tracks/fsharp/exercises/protein-translation/ProteinTranslationTest.fs +94 -60
  35. data/tracks/fsharp/exercises/react/ReactTest.fs +1 -1
  36. data/tracks/fsharp/exercises/rna-transcription/RnaTranscriptionTest.fs +1 -1
  37. data/tracks/fsharp/exercises/roman-numerals/RomanNumeralsTest.fs +1 -1
  38. data/tracks/fsharp/exercises/rotational-cipher/RotationalCipherTest.fs +1 -1
  39. data/tracks/fsharp/exercises/say/Example.fs +1 -1
  40. data/tracks/fsharp/exercises/say/SayTest.fs +21 -24
  41. data/tracks/fsharp/exercises/scrabble-score/ScrabbleScoreTest.fs +1 -1
  42. data/tracks/fsharp/exercises/secret-handshake/Example.fs +2 -2
  43. data/tracks/fsharp/exercises/secret-handshake/SecretHandshake.fs +1 -1
  44. data/tracks/fsharp/exercises/secret-handshake/SecretHandshakeTest.fs +39 -22
  45. data/tracks/fsharp/exercises/sieve/Example.fs +1 -1
  46. data/tracks/fsharp/exercises/sieve/Sieve.fs +1 -1
  47. data/tracks/fsharp/exercises/sieve/SieveTest.fs +19 -21
  48. data/tracks/fsharp/exercises/spiral-matrix/SpiralMatrixTest.fs +1 -1
  49. data/tracks/fsharp/exercises/sum-of-multiples/Example.fs +1 -1
  50. data/tracks/fsharp/exercises/sum-of-multiples/SumOfMultiples.fs +1 -1
  51. data/tracks/fsharp/exercises/sum-of-multiples/SumOfMultiplesTest.fs +44 -14
  52. data/tracks/fsharp/exercises/twelve-days/TwelveDaysTest.fs +1 -1
  53. data/tracks/fsharp/exercises/two-fer/Example.fs +1 -1
  54. data/tracks/fsharp/exercises/two-fer/TwoFer.fs +1 -1
  55. data/tracks/fsharp/exercises/two-fer/TwoFerTest.fs +4 -4
  56. data/tracks/fsharp/exercises/word-count/Example.fs +2 -2
  57. data/tracks/fsharp/exercises/word-count/WordCount.fs +2 -2
  58. data/tracks/fsharp/exercises/word-count/WordCountTest.fs +80 -100
  59. data/tracks/fsharp/exercises/wordy/Example.fs +2 -3
  60. data/tracks/fsharp/exercises/wordy/Wordy.fs +1 -1
  61. data/tracks/fsharp/exercises/wordy/WordyTest.fs +51 -49
  62. data/tracks/fsharp/exercises/zebra-puzzle/Example.fs +4 -4
  63. data/tracks/fsharp/exercises/zebra-puzzle/ZebraPuzzleTest.fs +7 -8
  64. data/tracks/fsharp/generators/Common.fs +3 -1
  65. data/tracks/fsharp/generators/Exercise.fs +12 -1
  66. data/tracks/fsharp/generators/Generators.fs +89 -42
  67. data/tracks/fsharp/generators/Generators.fsproj +1 -0
  68. data/tracks/fsharp/generators/Options.fs +14 -7
  69. data/tracks/fsharp/generators/Program.fs +3 -0
  70. data/tracks/fsharp/generators/Rendering.fs +0 -1
  71. data/tracks/fsharp/generators/Track.fs +26 -0
  72. data/tracks/go/exercises/custom-set/.meta/gen.go +16 -14
  73. data/tracks/go/exercises/custom-set/cases_test.go +2 -2
  74. data/tracks/java/exercises/food-chain/.meta/version +1 -0
  75. data/tracks/java/exercises/sieve/.meta/version +1 -0
  76. data/tracks/java/exercises/sieve/src/test/java/SieveTest.java +17 -0
  77. data/tracks/java/exercises/twelve-days/.meta/version +1 -0
  78. data/tracks/java/exercises/twelve-days/src/test/java/TwelveDaysTest.java +15 -3
  79. data/tracks/java/exercises/two-fer/.meta/version +1 -0
  80. data/tracks/java/exercises/two-fer/src/test/java/TwoferTest.java +0 -9
  81. data/tracks/ocaml/config/exercise_readme.go.tmpl +38 -4
  82. data/tracks/ocaml/exercises/acronym/README.md +0 -2
  83. data/tracks/ocaml/exercises/all-your-base/README.md +1 -3
  84. data/tracks/ocaml/exercises/anagram/README.md +0 -1
  85. data/tracks/ocaml/exercises/atbash-cipher/README.md +2 -2
  86. data/tracks/ocaml/exercises/beer-song/README.md +2 -3
  87. data/tracks/ocaml/exercises/binary-search/README.md +0 -1
  88. data/tracks/ocaml/exercises/bob/README.md +2 -1
  89. data/tracks/ocaml/exercises/bowling/README.md +20 -7
  90. data/tracks/ocaml/exercises/bracket-push/README.md +0 -1
  91. data/tracks/ocaml/exercises/change/README.md +1 -2
  92. data/tracks/ocaml/exercises/connect/README.md +1 -3
  93. data/tracks/ocaml/exercises/custom-set/README.md +0 -2
  94. data/tracks/ocaml/exercises/difference-of-squares/README.md +0 -1
  95. data/tracks/ocaml/exercises/dominoes/README.md +3 -5
  96. data/tracks/ocaml/exercises/etl/README.md +3 -2
  97. data/tracks/ocaml/exercises/forth/README.md +0 -2
  98. data/tracks/ocaml/exercises/grade-school/README.md +0 -1
  99. data/tracks/ocaml/exercises/hamming/README.md +0 -1
  100. data/tracks/ocaml/exercises/hangman/README.md +0 -2
  101. data/tracks/ocaml/exercises/hello-world/README.md +0 -1
  102. data/tracks/ocaml/exercises/hexadecimal/README.md +0 -1
  103. data/tracks/ocaml/exercises/leap/README.md +1 -2
  104. data/tracks/ocaml/exercises/list-ops/README.md +0 -2
  105. data/tracks/ocaml/exercises/luhn/README.md +7 -8
  106. data/tracks/ocaml/exercises/meetup/README.md +16 -14
  107. data/tracks/ocaml/exercises/minesweeper/README.md +0 -2
  108. data/tracks/ocaml/exercises/nucleotide-count/README.md +8 -23
  109. data/tracks/ocaml/exercises/palindrome-products/README.md +0 -1
  110. data/tracks/ocaml/exercises/pangram/README.md +1 -2
  111. data/tracks/ocaml/exercises/phone-number/README.md +4 -4
  112. data/tracks/ocaml/exercises/prime-factors/README.md +0 -1
  113. data/tracks/ocaml/exercises/raindrops/README.md +0 -1
  114. data/tracks/ocaml/exercises/react/README.md +0 -2
  115. data/tracks/ocaml/{docs/EXERCISE_README_INSERT.md → exercises/rectangles/README.md} +67 -0
  116. data/tracks/ocaml/exercises/rna-transcription/README.md +1 -2
  117. data/tracks/ocaml/exercises/robot-name/README.md +0 -1
  118. data/tracks/ocaml/exercises/roman-numerals/README.md +1 -2
  119. data/tracks/ocaml/exercises/run-length-encoding/README.md +4 -5
  120. data/tracks/ocaml/exercises/say/README.md +0 -1
  121. data/tracks/ocaml/exercises/space-age/README.md +1 -2
  122. data/tracks/ocaml/exercises/triangle/README.md +8 -6
  123. data/tracks/ocaml/exercises/word-count/README.md +1 -3
  124. data/tracks/ocaml/exercises/zipper/README.md +1 -3
  125. data/tracks/perl6/.travis.yml +1 -1
  126. data/tracks/perl6/bin/README.md +1 -2
  127. data/tracks/perl6/bin/exercise-gen.pl6 +18 -18
  128. data/tracks/perl6/config.json +1 -0
  129. data/tracks/perl6/exercises/accumulate/{example.yaml → .meta/exercise-data.yaml} +0 -0
  130. data/tracks/perl6/exercises/accumulate/{Example.pm6 → .meta/solutions/Accumulate.pm6} +0 -0
  131. data/tracks/perl6/exercises/acronym/{example.yaml → .meta/exercise-data.yaml} +0 -0
  132. data/tracks/perl6/exercises/acronym/{Example.pm6 → .meta/solutions/Acronym.pm6} +0 -0
  133. data/tracks/perl6/exercises/all-your-base/{example.yaml → .meta/exercise-data.yaml} +0 -0
  134. data/tracks/perl6/exercises/all-your-base/{Example.pm6 → .meta/solutions/AllYourBase.pm6} +0 -0
  135. data/tracks/perl6/exercises/allergies/{example.yaml → .meta/exercise-data.yaml} +0 -0
  136. data/tracks/perl6/exercises/allergies/{Example.pm6 → .meta/solutions/Allergies.pm6} +0 -0
  137. data/tracks/perl6/exercises/anagram/{example.yaml → .meta/exercise-data.yaml} +0 -0
  138. data/tracks/perl6/exercises/anagram/{Example.pm6 → .meta/solutions/Anagram.pm6} +0 -0
  139. data/tracks/perl6/exercises/atbash-cipher/{example.yaml → .meta/exercise-data.yaml} +0 -0
  140. data/tracks/perl6/exercises/atbash-cipher/{Example.pm6 → .meta/solutions/AtbashCipher.pm6} +0 -0
  141. data/tracks/perl6/exercises/binary/{Example.pm6 → .meta/solutions/Trinary.pm6} +0 -0
  142. data/tracks/perl6/exercises/bob/{example.yaml → .meta/exercise-data.yaml} +0 -0
  143. data/tracks/perl6/exercises/bob/{Example.pm6 → .meta/solutions/Bob.pm6} +0 -0
  144. data/tracks/perl6/exercises/clock/{example.yaml → .meta/exercise-data.yaml} +0 -0
  145. data/tracks/perl6/exercises/clock/{Example.pm6 → .meta/solutions/Clock.pm6} +0 -0
  146. data/tracks/perl6/exercises/etl/{example.yaml → .meta/exercise-data.yaml} +0 -0
  147. data/tracks/perl6/exercises/etl/{Example.pm6 → .meta/solutions/ETL.pm6} +0 -0
  148. data/tracks/perl6/exercises/flatten-array/{example.yaml → .meta/exercise-data.yaml} +0 -0
  149. data/tracks/perl6/exercises/flatten-array/{Example.pm6 → .meta/solutions/FlattenArray.pm6} +0 -0
  150. data/tracks/perl6/exercises/grade-school/{example.yaml → .meta/exercise-data.yaml} +0 -0
  151. data/tracks/perl6/exercises/grade-school/{Example.pm6 → .meta/solutions/GradeSchool.pm6} +0 -0
  152. data/tracks/perl6/exercises/grains/{example.yaml → .meta/exercise-data.yaml} +0 -0
  153. data/tracks/perl6/exercises/grains/{Example.pm6 → .meta/solutions/Grains.pm6} +0 -0
  154. data/tracks/perl6/exercises/hamming/{example.yaml → .meta/exercise-data.yaml} +0 -0
  155. data/tracks/perl6/exercises/hamming/{Example.pm6 → .meta/solutions/Hamming.pm6} +0 -0
  156. data/tracks/perl6/exercises/hello-world/{example.yaml → .meta/exercise-data.yaml} +0 -0
  157. data/tracks/perl6/exercises/hello-world/{Example.pm6 → .meta/solutions/HelloWorld.pm6} +0 -0
  158. data/tracks/perl6/exercises/leap/{example.yaml → .meta/exercise-data.yaml} +0 -0
  159. data/tracks/perl6/exercises/leap/{Example.pm6 → .meta/solutions/Leap.pm6} +0 -0
  160. data/tracks/perl6/exercises/linked-list/{example.yaml → .meta/exercise-data.yaml} +0 -0
  161. data/tracks/perl6/exercises/linked-list/{Example.pm6 → .meta/solutions/LinkedList.pm6} +0 -0
  162. data/tracks/perl6/exercises/luhn/{example.yaml → .meta/exercise-data.yaml} +0 -0
  163. data/tracks/perl6/exercises/luhn/{Example.pm6 → .meta/solutions/Luhn.pm6} +0 -0
  164. data/tracks/perl6/exercises/meetup/{example.yaml → .meta/exercise-data.yaml} +0 -0
  165. data/tracks/perl6/exercises/meetup/{Example.pm6 → .meta/solutions/Meetup.pm6} +0 -0
  166. data/tracks/perl6/exercises/nucleotide-count/{example.yaml → .meta/exercise-data.yaml} +0 -0
  167. data/tracks/perl6/exercises/nucleotide-count/{Example.pm6 → .meta/solutions/NucleotideCount.pm6} +0 -0
  168. data/tracks/perl6/exercises/pangram/{example.yaml → .meta/exercise-data.yaml} +0 -0
  169. data/tracks/perl6/exercises/pangram/{Example.pm6 → .meta/solutions/Pangram.pm6} +0 -0
  170. data/tracks/perl6/exercises/phone-number/{example.yaml → .meta/exercise-data.yaml} +0 -0
  171. data/tracks/perl6/exercises/phone-number/{Example.pm6 → .meta/solutions/Phone.pm6} +0 -0
  172. data/tracks/perl6/exercises/raindrops/{example.yaml → .meta/exercise-data.yaml} +0 -0
  173. data/tracks/perl6/exercises/raindrops/{Example.pm6 → .meta/solutions/Raindrops.pm6} +0 -0
  174. data/tracks/perl6/exercises/rna-transcription/{example.yaml → .meta/exercise-data.yaml} +0 -0
  175. data/tracks/perl6/exercises/rna-transcription/{Example.pm6 → .meta/solutions/RNA.pm6} +0 -0
  176. data/tracks/perl6/exercises/robot-name/{example.yaml → .meta/exercise-data.yaml} +0 -0
  177. data/tracks/perl6/exercises/robot-name/{Example.pm6 → .meta/solutions/Robot.pm6} +0 -0
  178. data/tracks/perl6/exercises/roman-numerals/{example.yaml → .meta/exercise-data.yaml} +0 -0
  179. data/tracks/perl6/exercises/roman-numerals/{Example.pm6 → .meta/solutions/RomanNumerals.pm6} +0 -0
  180. data/tracks/perl6/exercises/scrabble-score/{example.yaml → .meta/exercise-data.yaml} +0 -0
  181. data/tracks/perl6/exercises/scrabble-score/{Example.pm6 → .meta/solutions/Scrabble.pm6} +0 -0
  182. data/tracks/perl6/exercises/space-age/{example.yaml → .meta/exercise-data.yaml} +0 -0
  183. data/tracks/perl6/exercises/space-age/{Example.pm6 → .meta/solutions/SpaceAge.pm6} +0 -0
  184. data/tracks/perl6/exercises/trinary/{Example.pm6 → .meta/solutions/Trinary.pm6} +0 -0
  185. data/tracks/perl6/exercises/two-fer/{example.yaml → .meta/exercise-data.yaml} +0 -0
  186. data/tracks/perl6/exercises/two-fer/{Example.pm6 → .meta/solutions/TwoFer.pm6} +0 -0
  187. data/tracks/perl6/exercises/word-count/{example.yaml → .meta/exercise-data.yaml} +0 -0
  188. data/tracks/perl6/exercises/word-count/{Example.pm6 → .meta/solutions/WordCount.pm6} +0 -0
  189. data/tracks/perl6/exercises/wordy/{example.yaml → .meta/exercise-data.yaml} +0 -0
  190. data/tracks/perl6/exercises/wordy/{Example.pm6 → .meta/solutions/Wordy.pm6} +0 -0
  191. data/tracks/perl6/t/generated-tests.t +2 -2
  192. data/tracks/python/config.json +12 -0
  193. data/tracks/python/exercises/bowling/.gitignore +0 -0
  194. data/tracks/python/exercises/bowling/bowling.py +11 -0
  195. data/tracks/python/exercises/bowling/bowling_test.py +193 -0
  196. data/tracks/python/exercises/bowling/example.py +149 -0
  197. data/tracks/python/exercises/say/say_test.py +1 -1
  198. data/tracks/ruby/README.md +121 -97
  199. data/tracks/ruby/config/exercise_readme.go.tmpl +23 -4
  200. data/tracks/ruby/exercises/accumulate/{HINTS.md → .meta/hints.md} +0 -0
  201. data/tracks/ruby/exercises/accumulate/README.md +3 -5
  202. data/tracks/ruby/exercises/acronym/README.md +3 -6
  203. data/tracks/ruby/exercises/all-your-base/README.md +4 -7
  204. data/tracks/ruby/exercises/allergies/README.md +3 -6
  205. data/tracks/ruby/exercises/alphametics/README.md +5 -8
  206. data/tracks/ruby/exercises/anagram/README.md +3 -5
  207. data/tracks/ruby/exercises/atbash-cipher/README.md +5 -6
  208. data/tracks/ruby/exercises/beer-song/README.md +5 -7
  209. data/tracks/ruby/exercises/binary-search-tree/README.md +3 -5
  210. data/tracks/ruby/exercises/binary-search/README.md +3 -5
  211. data/tracks/ruby/exercises/binary/README.md +5 -5
  212. data/tracks/ruby/exercises/bob/README.md +3 -5
  213. data/tracks/ruby/exercises/book-store/README.md +3 -5
  214. data/tracks/ruby/exercises/bowling/README.md +23 -11
  215. data/tracks/ruby/exercises/bracket-push/README.md +3 -5
  216. data/tracks/ruby/exercises/change/README.md +3 -5
  217. data/tracks/ruby/exercises/circular-buffer/README.md +16 -11
  218. data/tracks/ruby/exercises/clock/README.md +3 -5
  219. data/tracks/ruby/exercises/collatz-conjecture/README.md +4 -6
  220. data/tracks/ruby/exercises/complex-numbers/README.md +6 -8
  221. data/tracks/ruby/exercises/connect/README.md +4 -7
  222. data/tracks/ruby/exercises/crypto-square/README.md +3 -5
  223. data/tracks/ruby/exercises/custom-set/README.md +3 -6
  224. data/tracks/ruby/exercises/diamond/README.md +9 -11
  225. data/tracks/ruby/exercises/difference-of-squares/README.md +3 -5
  226. data/tracks/ruby/exercises/dominoes/README.md +6 -9
  227. data/tracks/ruby/exercises/etl/README.md +6 -6
  228. data/tracks/ruby/exercises/flatten-array/README.md +5 -8
  229. data/tracks/ruby/exercises/food-chain/README.md +4 -6
  230. data/tracks/ruby/exercises/gigasecond/README.md +3 -5
  231. data/tracks/ruby/exercises/grade-school/README.md +3 -6
  232. data/tracks/ruby/exercises/grains/README.md +3 -6
  233. data/tracks/ruby/exercises/hamming/README.md +3 -5
  234. data/tracks/ruby/exercises/hello-world/README.md +1 -3
  235. data/tracks/ruby/exercises/hexadecimal/README.md +3 -5
  236. data/tracks/ruby/exercises/house/README.md +5 -8
  237. data/tracks/ruby/exercises/isbn-verifier/README.md +4 -6
  238. data/tracks/ruby/exercises/isogram/README.md +5 -6
  239. data/tracks/ruby/exercises/kindergarten-garden/README.md +16 -18
  240. data/tracks/ruby/exercises/largest-series-product/README.md +3 -5
  241. data/tracks/ruby/exercises/leap/README.md +4 -6
  242. data/tracks/ruby/exercises/linked-list/README.md +13 -15
  243. data/tracks/ruby/exercises/list-ops/README.md +3 -6
  244. data/tracks/ruby/exercises/luhn/README.md +10 -12
  245. data/tracks/ruby/exercises/matrix/README.md +9 -9
  246. data/tracks/ruby/exercises/meetup/README.md +19 -18
  247. data/tracks/ruby/exercises/minesweeper/README.md +3 -6
  248. data/tracks/ruby/exercises/nth-prime/README.md +3 -5
  249. data/tracks/ruby/exercises/nucleotide-count/README.md +11 -27
  250. data/tracks/ruby/exercises/ocr-numbers/README.md +9 -11
  251. data/tracks/ruby/exercises/octal/README.md +9 -7
  252. data/tracks/ruby/exercises/palindrome-products/README.md +8 -17
  253. data/tracks/ruby/exercises/pangram/README.md +4 -6
  254. data/tracks/ruby/exercises/pascals-triangle/README.md +5 -7
  255. data/tracks/ruby/exercises/perfect-numbers/README.md +5 -7
  256. data/tracks/ruby/exercises/phone-number/README.md +7 -8
  257. data/tracks/ruby/exercises/pig-latin/README.md +3 -5
  258. data/tracks/ruby/exercises/point-mutations/README.md +3 -5
  259. data/tracks/ruby/exercises/poker/README.md +3 -5
  260. data/tracks/ruby/exercises/prime-factors/README.md +3 -5
  261. data/tracks/ruby/exercises/protein-translation/README.md +7 -10
  262. data/tracks/ruby/exercises/proverb/README.md +17 -14
  263. data/tracks/ruby/exercises/pythagorean-triplet/README.md +6 -8
  264. data/tracks/ruby/exercises/queen-attack/README.md +4 -6
  265. data/tracks/ruby/exercises/rail-fence-cipher/README.md +15 -12
  266. data/tracks/ruby/exercises/raindrops/README.md +3 -5
  267. data/tracks/ruby/exercises/rna-transcription/README.md +4 -6
  268. data/tracks/ruby/exercises/robot-name/{HINTS.md → .meta/hints.md} +0 -0
  269. data/tracks/ruby/exercises/robot-name/README.md +3 -5
  270. data/tracks/ruby/exercises/robot-simulator/README.md +3 -5
  271. data/tracks/ruby/exercises/roman-numerals/README.md +4 -6
  272. data/tracks/ruby/exercises/rotational-cipher/README.md +3 -5
  273. data/tracks/ruby/exercises/run-length-encoding/README.md +7 -9
  274. data/tracks/ruby/exercises/saddle-points/README.md +5 -7
  275. data/tracks/ruby/exercises/say/README.md +3 -5
  276. data/tracks/ruby/exercises/scale-generator/README.md +3 -7
  277. data/tracks/ruby/exercises/scrabble-score/README.md +6 -6
  278. data/tracks/ruby/exercises/secret-handshake/README.md +4 -6
  279. data/tracks/ruby/exercises/series/README.md +3 -5
  280. data/tracks/ruby/exercises/sieve/README.md +3 -5
  281. data/tracks/ruby/exercises/simple-cipher/README.md +7 -11
  282. data/tracks/ruby/exercises/simple-linked-list/README.md +3 -5
  283. data/tracks/ruby/exercises/space-age/README.md +4 -6
  284. data/tracks/ruby/exercises/strain/README.md +3 -5
  285. data/tracks/ruby/exercises/sum-of-multiples/README.md +6 -11
  286. data/tracks/ruby/exercises/tournament/README.md +8 -11
  287. data/tracks/ruby/exercises/transpose/README.md +10 -12
  288. data/tracks/ruby/exercises/triangle/README.md +12 -11
  289. data/tracks/ruby/exercises/trinary/README.md +4 -6
  290. data/tracks/ruby/exercises/twelve-days/README.md +4 -6
  291. data/tracks/ruby/exercises/two-bucket/README.md +13 -15
  292. data/tracks/ruby/exercises/two-fer/README.md +13 -39
  293. data/tracks/ruby/exercises/word-count/README.md +4 -7
  294. data/tracks/ruby/exercises/wordy/README.md +3 -10
  295. metadata +77 -68
  296. data/tracks/ruby/docs/EXERCISE_README_INSERT.md +0 -24
@@ -5,6 +5,6 @@ let rec private sieve remainder primes =
5
5
  | [] -> primes |> List.rev
6
6
  | p::xs -> sieve (xs |> List.filter (fun x -> x % p > 0)) (p :: primes)
7
7
 
8
- let primesUpTo limit =
8
+ let primes limit =
9
9
  let possiblePrimes = [2 .. limit]
10
10
  sieve possiblePrimes []
@@ -1,3 +1,3 @@
1
1
  module Sieve
2
2
 
3
- let primesUpTo limit = failwith "You need to implement this function."
3
+ let primes limit = failwith "You need to implement this function."
@@ -1,31 +1,29 @@
1
- // This file was created manually and its version is 1.0.0.
1
+ // This file was auto-generated based on version 1.1.0 of the canonical data.
2
2
 
3
3
  module SieveTest
4
4
 
5
- open Xunit
6
5
  open FsUnit.Xunit
6
+ open Xunit
7
7
 
8
8
  open Sieve
9
9
 
10
10
  [<Fact>]
11
- let ``Finds first prime`` () =
12
- primesUpTo 2 |> should equal [ 2 ]
13
-
11
+ let ``No primes under two`` () =
12
+ primes 1 |> should be Empty
13
+
14
14
  [<Fact(Skip = "Remove to run test")>]
15
- let ``Finds primes up to 10`` () =
16
- primesUpTo 10 |> should equal [ 2; 3; 5; 7 ]
17
-
15
+ let ``Find first prime`` () =
16
+ primes 2 |> should equal [2]
17
+
18
18
  [<Fact(Skip = "Remove to run test")>]
19
- let ``Finds primes up to 1000`` () =
20
- primesUpTo 1000 |> should equal
21
- [
22
- 2; 3; 5; 7; 11; 13; 17; 19; 23; 29; 31; 37; 41; 43; 47; 53; 59; 61; 67; 71; 73; 79; 83; 89; 97; 101;
23
- 103; 107; 109; 113; 127; 131; 137; 139; 149; 151; 157; 163; 167; 173; 179; 181; 191; 193; 197; 199;
24
- 211; 223; 227; 229; 233; 239; 241; 251; 257; 263; 269; 271; 277; 281; 283; 293; 307; 311; 313; 317;
25
- 331; 337; 347; 349; 353; 359; 367; 373; 379; 383; 389; 397; 401; 409; 419; 421; 431; 433; 439; 443;
26
- 449; 457; 461; 463; 467; 479; 487; 491; 499; 503; 509; 521; 523; 541; 547; 557; 563; 569; 571; 577;
27
- 587; 593; 599; 601; 607; 613; 617; 619; 631; 641; 643; 647; 653; 659; 661; 673; 677; 683; 691; 701;
28
- 709; 719; 727; 733; 739; 743; 751; 757; 761; 769; 773; 787; 797; 809; 811; 821; 823; 827; 829; 839;
29
- 853; 857; 859; 863; 877; 881; 883; 887; 907; 911; 919; 929; 937; 941; 947; 953; 967; 971; 977; 983;
30
- 991; 997
31
- ]
19
+ let ``Find primes up to 10`` () =
20
+ primes 10 |> should equal [2; 3; 5; 7]
21
+
22
+ [<Fact(Skip = "Remove to run test")>]
23
+ let ``Limit is prime`` () =
24
+ primes 13 |> should equal [2; 3; 5; 7; 11; 13]
25
+
26
+ [<Fact(Skip = "Remove to run test")>]
27
+ let ``Find primes up to 1000`` () =
28
+ primes 1000 |> should equal [2; 3; 5; 7; 11; 13; 17; 19; 23; 29; 31; 37; 41; 43; 47; 53; 59; 61; 67; 71; 73; 79; 83; 89; 97; 101; 103; 107; 109; 113; 127; 131; 137; 139; 149; 151; 157; 163; 167; 173; 179; 181; 191; 193; 197; 199; 211; 223; 227; 229; 233; 239; 241; 251; 257; 263; 269; 271; 277; 281; 283; 293; 307; 311; 313; 317; 331; 337; 347; 349; 353; 359; 367; 373; 379; 383; 389; 397; 401; 409; 419; 421; 431; 433; 439; 443; 449; 457; 461; 463; 467; 479; 487; 491; 499; 503; 509; 521; 523; 541; 547; 557; 563; 569; 571; 577; 587; 593; 599; 601; 607; 613; 617; 619; 631; 641; 643; 647; 653; 659; 661; 673; 677; 683; 691; 701; 709; 719; 727; 733; 739; 743; 751; 757; 761; 769; 773; 787; 797; 809; 811; 821; 823; 827; 829; 839; 853; 857; 859; 863; 877; 881; 883; 887; 907; 911; 919; 929; 937; 941; 947; 953; 967; 971; 977; 983; 991; 997]
29
+
@@ -1,4 +1,4 @@
1
- // This file was auto-generated based on version 1.0.0 of the canonical data.
1
+ // This file was auto-generated based on version 1.1.0 of the canonical data.
2
2
 
3
3
  module SpiralMatrixTest
4
4
 
@@ -1,6 +1,6 @@
1
1
  module SumOfMultiples
2
2
 
3
- let sumOfMultiples numbers upperBound =
3
+ let sum numbers upperBound =
4
4
  let isMultiple x = numbers |> List.exists (fun y -> x % y = 0)
5
5
 
6
6
  [1 .. upperBound - 1]
@@ -1,3 +1,3 @@
1
1
  module SumOfMultiples
2
2
 
3
- let sumOfMultiples (numbers: int list) (upperBound: int): int = failwith "You need to implement this function."
3
+ let sum (numbers: int list) (upperBound: int): int = failwith "You need to implement this function."
@@ -1,31 +1,61 @@
1
- // This file was created manually and its version is 1.0.0.
1
+ // This file was auto-generated based on version 1.2.0 of the canonical data.
2
2
 
3
3
  module SumOfMultiplesTest
4
4
 
5
- open Xunit
6
5
  open FsUnit.Xunit
6
+ open Xunit
7
+
7
8
  open SumOfMultiples
8
9
 
9
10
  [<Fact>]
10
- let ``Sum to 1`` () =
11
- sumOfMultiples [3; 5] 0 |> should equal 0
11
+ let ``Multiples of 3 or 5 up to 1`` () =
12
+ sum [3; 5] 1 |> should equal 0
13
+
14
+ [<Fact(Skip = "Remove to run test")>]
15
+ let ``Multiples of 3 or 5 up to 4`` () =
16
+ sum [3; 5] 4 |> should equal 3
17
+
18
+ [<Fact(Skip = "Remove to run test")>]
19
+ let ``Multiples of 3 up to 7`` () =
20
+ sum [3] 7 |> should equal 9
21
+
22
+ [<Fact(Skip = "Remove to run test")>]
23
+ let ``Multiples of 3 or 5 up to 10`` () =
24
+ sum [3; 5] 10 |> should equal 23
12
25
 
13
26
  [<Fact(Skip = "Remove to run test")>]
14
- let ``Sum to 3`` () =
15
- sumOfMultiples [3; 5] 3 |> should equal 0
27
+ let ``Multiples of 3 or 5 up to 100`` () =
28
+ sum [3; 5] 100 |> should equal 2318
16
29
 
17
30
  [<Fact(Skip = "Remove to run test")>]
18
- let ``Sum to 4`` () =
19
- sumOfMultiples [3; 5] 4 |> should equal 3
31
+ let ``Multiples of 3 or 5 up to 1000`` () =
32
+ sum [3; 5] 1000 |> should equal 233168
20
33
 
21
34
  [<Fact(Skip = "Remove to run test")>]
22
- let ``Sum to 10`` () =
23
- sumOfMultiples [3; 5] 10 |> should equal 23
35
+ let ``Multiples of 7, 13 or 17 up to 20`` () =
36
+ sum [7; 13; 17] 20 |> should equal 51
24
37
 
25
38
  [<Fact(Skip = "Remove to run test")>]
26
- let ``Sum to 20`` () =
27
- sumOfMultiples [7; 13; 17] 20 |> should equal 51
39
+ let ``Multiples of 4 or 6 up to 15`` () =
40
+ sum [4; 6] 15 |> should equal 30
28
41
 
29
42
  [<Fact(Skip = "Remove to run test")>]
30
- let ``Sum to 10000`` () =
31
- sumOfMultiples [43; 47] 10000 |> should equal 2203160
43
+ let ``Multiples of 5, 6 or 8 up to 150`` () =
44
+ sum [5; 6; 8] 150 |> should equal 4419
45
+
46
+ [<Fact(Skip = "Remove to run test")>]
47
+ let ``Multiples of 5 or 25 up to 51`` () =
48
+ sum [5; 25] 51 |> should equal 275
49
+
50
+ [<Fact(Skip = "Remove to run test")>]
51
+ let ``Multiples of 43 or 47 up to 10000`` () =
52
+ sum [43; 47] 10000 |> should equal 2203160
53
+
54
+ [<Fact(Skip = "Remove to run test")>]
55
+ let ``Multiples of 1 up to 100`` () =
56
+ sum [1] 100 |> should equal 4950
57
+
58
+ [<Fact(Skip = "Remove to run test")>]
59
+ let ``Multiples of an empty list up to 10000`` () =
60
+ sum [] 10000 |> should equal 0
61
+
@@ -1,4 +1,4 @@
1
- // This file was auto-generated based on version 1.0.0 of the canonical data.
1
+ // This file was auto-generated based on version 1.1.0 of the canonical data.
2
2
 
3
3
  module TwelveDaysTest
4
4
 
@@ -1,6 +1,6 @@
1
1
  module TwoFer
2
2
 
3
- let name input =
3
+ let twoFer input =
4
4
  input
5
5
  |> Option.defaultValue "you"
6
6
  |> sprintf "One for %s, one for me."
@@ -1,3 +1,3 @@
1
1
  module TwoFer
2
2
 
3
- let name (input: string option): string = failwith "You need to implement this function."
3
+ let twoFer (input: string option): string = failwith "You need to implement this function."
@@ -1,4 +1,4 @@
1
- // This file was auto-generated based on version 1.1.0 of the canonical data.
1
+ // This file was auto-generated based on version 1.2.0 of the canonical data.
2
2
 
3
3
  module TwoFerTest
4
4
 
@@ -9,13 +9,13 @@ open TwoFer
9
9
 
10
10
  [<Fact>]
11
11
  let ``No name given`` () =
12
- name None |> should equal "One for you, one for me."
12
+ twoFer None |> should equal "One for you, one for me."
13
13
 
14
14
  [<Fact(Skip = "Remove to run test")>]
15
15
  let ``A name given`` () =
16
- name (Some "Alice") |> should equal "One for Alice, one for me."
16
+ twoFer (Some "Alice") |> should equal "One for Alice, one for me."
17
17
 
18
18
  [<Fact(Skip = "Remove to run test")>]
19
19
  let ``Another name given`` () =
20
- name (Some "Bob") |> should equal "One for Bob, one for me."
20
+ twoFer (Some "Bob") |> should equal "One for Bob, one for me."
21
21
 
@@ -1,8 +1,8 @@
1
- module Phrase
1
+ module WordCount
2
2
 
3
3
  open System.Text.RegularExpressions
4
4
 
5
- let wordCount (phrase: string) =
5
+ let countwords (phrase: string) =
6
6
  Regex.Matches(phrase.ToLowerInvariant(), @"\w+('\w+)*")
7
7
  |> Seq.cast<Match>
8
8
  |> Seq.countBy (fun m -> m.Value)
@@ -1,3 +1,3 @@
1
- module Phrase
1
+ module WordCount
2
2
 
3
- let wordCount phrase = failwith "You need to implement this function."
3
+ let countwords phrase = failwith "You need to implement this function."
@@ -1,131 +1,111 @@
1
- // This file was created manually and its version is 1.0.0.
1
+ // This file was auto-generated based on version 1.1.0 of the canonical data.
2
2
 
3
3
  module WordCountTest
4
4
 
5
- open Xunit
6
5
  open FsUnit.Xunit
7
- open Phrase
6
+ open Xunit
7
+
8
+ open WordCount
8
9
 
9
10
  [<Fact>]
10
11
  let ``Count one word`` () =
11
- let phrase = "word"
12
- let counts = Map.ofSeq [("word", 1)]
13
-
14
- wordCount phrase |> should equal counts
12
+ let expected = [("word", 1)] |> Map.ofList
13
+ countwords "word" |> should equal expected
15
14
 
16
15
  [<Fact(Skip = "Remove to run test")>]
17
- let ``Count one of each`` () =
18
- let phrase = "one of each"
19
- let counts = Map.ofSeq [("one", 1);
20
- ("of", 1);
21
- ("each", 1)]
22
-
23
- wordCount phrase |> should equal counts
16
+ let ``Count one of each word`` () =
17
+ let expected =
18
+ [ ("one", 1);
19
+ ("of", 1);
20
+ ("each", 1) ]
21
+ |> Map.ofList
22
+ countwords "one of each" |> should equal expected
24
23
 
25
24
  [<Fact(Skip = "Remove to run test")>]
26
- let ``Count multiple occurrences`` () =
27
- let phrase = "one fish two fish red fish blue fish"
28
- let counts = Map.ofSeq [("one", 1);
29
- ("fish", 4);
30
- ("two", 1);
31
- ("red", 1);
32
- ("blue", 1)]
33
-
34
- wordCount phrase |> should equal counts
25
+ let ``Multiple occurrences of a word`` () =
26
+ let expected =
27
+ [ ("one", 1);
28
+ ("fish", 4);
29
+ ("two", 1);
30
+ ("red", 1);
31
+ ("blue", 1) ]
32
+ |> Map.ofList
33
+ countwords "one fish two fish red fish blue fish" |> should equal expected
35
34
 
36
35
  [<Fact(Skip = "Remove to run test")>]
37
- let ``Count everything just once`` () =
38
- let phrase = "all the kings horses and all the kings men"
39
- let counts = Map.ofSeq [("all", 2);
40
- ("the", 2);
41
- ("kings", 2);
42
- ("horses", 1);
43
- ("and", 1);
44
- ("men", 1)]
45
-
46
- wordCount phrase |> should equal counts
36
+ let ``Handles cramped lists`` () =
37
+ let expected =
38
+ [ ("one", 1);
39
+ ("two", 1);
40
+ ("three", 1) ]
41
+ |> Map.ofList
42
+ countwords "one,two,three" |> should equal expected
47
43
 
48
44
  [<Fact(Skip = "Remove to run test")>]
49
- let ``Ignore punctuation`` () =
50
- let phrase = "car : carpet as java : javascript!!&@$%^&"
51
- let counts = Map.ofSeq [("car", 1);
52
- ("carpet", 1);
53
- ("as", 1);
54
- ("java", 1);
55
- ("javascript", 1)]
56
-
57
- wordCount phrase |> should equal counts
45
+ let ``Handles expanded lists`` () =
46
+ let expected =
47
+ [ ("one", 1);
48
+ ("two", 1);
49
+ ("three", 1) ]
50
+ |> Map.ofList
51
+ countwords "one,\ntwo,\nthree" |> should equal expected
58
52
 
59
53
  [<Fact(Skip = "Remove to run test")>]
60
- let ``Handles cramped list`` () =
61
- let phrase = "one,two,three"
62
- let counts = Map.ofSeq [("one", 1);
63
- ("two", 1);
64
- ("three", 1)]
65
-
66
- wordCount phrase |> should equal counts
54
+ let ``Ignore punctuation`` () =
55
+ let expected =
56
+ [ ("car", 1);
57
+ ("carpet", 1);
58
+ ("as", 1);
59
+ ("java", 1);
60
+ ("javascript", 1) ]
61
+ |> Map.ofList
62
+ countwords "car: carpet as java: javascript!!&@$%^&" |> should equal expected
67
63
 
68
64
  [<Fact(Skip = "Remove to run test")>]
69
65
  let ``Include numbers`` () =
70
- let phrase = "testing, 1, 2 testing"
71
- let counts = Map.ofSeq [("testing", 2);
72
- ("1", 1);
73
- ("2", 1)]
74
-
75
- wordCount phrase |> should equal counts
66
+ let expected =
67
+ [ ("testing", 2);
68
+ ("1", 1);
69
+ ("2", 1) ]
70
+ |> Map.ofList
71
+ countwords "testing, 1, 2 testing" |> should equal expected
76
72
 
77
73
  [<Fact(Skip = "Remove to run test")>]
78
74
  let ``Normalize case`` () =
79
- let phrase = "go Go GO"
80
- let counts = Map.ofSeq [("go", 3)]
81
-
82
- wordCount phrase |> should equal counts
75
+ let expected =
76
+ [ ("go", 3);
77
+ ("stop", 2) ]
78
+ |> Map.ofList
79
+ countwords "go Go GO Stop stop" |> should equal expected
83
80
 
84
81
  [<Fact(Skip = "Remove to run test")>]
85
82
  let ``With apostrophes`` () =
86
- let phrase = "First: don't laugh. Then: don't cry."
87
- let counts = Map.ofSeq [("first", 1);
88
- ("don't", 2);
89
- ("laugh", 1);
90
- ("then", 1);
91
- ("cry", 1)]
92
-
93
- wordCount phrase |> should equal counts
83
+ let expected =
84
+ [ ("first", 1);
85
+ ("don't", 2);
86
+ ("laugh", 1);
87
+ ("then", 1);
88
+ ("cry", 1) ]
89
+ |> Map.ofList
90
+ countwords "First: don't laugh. Then: don't cry." |> should equal expected
94
91
 
95
92
  [<Fact(Skip = "Remove to run test")>]
96
- let ``With free standing apostrophes`` () =
97
- let phrase = "go ' Go '' GO"
98
- let counts = Map.ofSeq [("go", 3)]
99
-
100
- wordCount phrase |> should equal counts
101
-
102
- [<Fact(Skip = "Remove to run test")>]
103
- let ``With apostrophes as quotes`` () =
104
- let phrase = "She said, 'let's meet at twelve o'clock'"
105
- let counts = Map.ofSeq [("she", 1);
106
- ("said", 1);
107
- ("let's", 1);
108
- ("meet", 1);
109
- ("at", 1);
110
- ("twelve", 1);
111
- ("o'clock", 1)]
112
-
113
- wordCount phrase |> should equal counts
93
+ let ``With quotations`` () =
94
+ let expected =
95
+ [ ("joe", 1);
96
+ ("can't", 1);
97
+ ("tell", 1);
98
+ ("between", 1);
99
+ ("large", 2);
100
+ ("and", 1) ]
101
+ |> Map.ofList
102
+ countwords "Joe can't tell between 'large' and large." |> should equal expected
114
103
 
115
104
  [<Fact(Skip = "Remove to run test")>]
116
- let ``With multiple lines`` () =
117
- let phrase = "Your time will come. You will face the same Evil, and you will defeat it."
118
- let counts = Map.ofSeq [("and", 1);
119
- ("come", 1);
120
- ("defeat", 1);
121
- ("evil", 1);
122
- ("face", 1);
123
- ("it", 1);
124
- ("same", 1);
125
- ("the", 1);
126
- ("time", 1);
127
- ("will", 3);
128
- ("you", 2);
129
- ("your", 1)]
105
+ let ``Multiple spaces not detected as a word`` () =
106
+ let expected =
107
+ [ ("multiple", 1);
108
+ ("whitespaces", 1) ]
109
+ |> Map.ofList
110
+ countwords " multiple whitespaces" |> should equal expected
130
111
 
131
- wordCount phrase |> should equal counts
@@ -1,12 +1,11 @@
1
1
  module Wordy
2
2
 
3
- open System
4
3
  open System.Text.RegularExpressions
5
4
 
6
5
  type Operation = int -> int
7
6
  type Equation = int * (Operation list)
8
7
 
9
- let equationRegex = new Regex(@"(?<left>-?\d+) (?<operation>-?plus|minus|divided by|multiplied by) (?=(?<right>-?\d+))", RegexOptions.Compiled)
8
+ let equationRegex = Regex(@"(?<left>-?\d+) (?<operation>-?plus|minus|divided by|multiplied by) (?=(?<right>-?\d+))", RegexOptions.Compiled)
10
9
 
11
10
  let regexGroupStr (group: string) (m: Match) = m.Groups.[group].Value
12
11
  let regexGroupNumber (group: string) (m: Match) = regexGroupStr group m |> int
@@ -43,7 +42,7 @@ let parse (question: string): Equation option =
43
42
  | m when m.Count = 0 -> None
44
43
  | m -> Some (parseLeft m, parseOperations m)
45
44
 
46
- let solve (question: string): int option =
45
+ let answer (question: string): int option =
47
46
  question
48
47
  |> parse
49
48
  |> Option.map calculate