trackler 2.2.1.91 → 2.2.1.92

Sign up to get free protection for your applications and to get access to all the features.
Files changed (233) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/exercises/diamond/metadata.yml +1 -1
  4. data/problem-specifications/exercises/food-chain/canonical-data.json +42 -22
  5. data/problem-specifications/exercises/hello-world/canonical-data.json +2 -1
  6. data/problem-specifications/exercises/isbn-verifier/metadata.yml +2 -1
  7. data/problem-specifications/exercises/largest-series-product/canonical-data.json +62 -33
  8. data/problem-specifications/exercises/leap/canonical-data.json +14 -6
  9. data/problem-specifications/exercises/list-ops/canonical-data.json +6 -6
  10. data/problem-specifications/exercises/markdown/canonical-data.json +29 -11
  11. data/problem-specifications/exercises/minesweeper/canonical-data.json +80 -56
  12. data/problem-specifications/exercises/minesweeper/metadata.yml +1 -1
  13. data/problem-specifications/exercises/nth-prime/canonical-data.json +20 -8
  14. data/problem-specifications/exercises/nucleotide-count/canonical-data.json +17 -7
  15. data/problem-specifications/exercises/pascals-triangle/canonical-data.json +28 -10
  16. data/problem-specifications/exercises/perfect-numbers/canonical-data.json +41 -15
  17. data/problem-specifications/exercises/phone-number/canonical-data.json +44 -16
  18. data/problem-specifications/exercises/pig-latin/canonical-data.json +68 -24
  19. data/problem-specifications/exercises/reverse-string/metadata.yml +1 -1
  20. data/problem-specifications/exercises/rna-transcription/canonical-data.json +17 -7
  21. data/problem-specifications/exercises/roman-numerals/canonical-data.json +56 -20
  22. data/problem-specifications/exercises/rotational-cipher/canonical-data.json +42 -22
  23. data/problem-specifications/exercises/saddle-points/canonical-data.json +34 -24
  24. data/problem-specifications/exercises/scrabble-score/canonical-data.json +35 -13
  25. data/problem-specifications/exercises/secret-handshake/canonical-data.json +34 -12
  26. data/problem-specifications/exercises/sieve/canonical-data.json +16 -6
  27. data/problem-specifications/exercises/space-age/canonical-data.json +34 -18
  28. data/problem-specifications/exercises/spiral-matrix/canonical-data.json +19 -7
  29. data/problem-specifications/exercises/sublist/canonical-data.json +69 -35
  30. data/problem-specifications/exercises/twelve-days/canonical-data.json +61 -31
  31. data/problem-specifications/exercises/variable-length-quantity/canonical-data.json +79 -27
  32. data/problem-specifications/exercises/zebra-puzzle/canonical-data.json +3 -1
  33. data/tracks/csharp/exercises/accumulate/{HINTS.md → .meta/hints.md} +0 -0
  34. data/tracks/csharp/exercises/allergies/{HINTS.md → .meta/hints.md} +0 -0
  35. data/tracks/csharp/exercises/alphametics/{HINTS.md → .meta/hints.md} +0 -0
  36. data/tracks/csharp/exercises/bank-account/{HINTS.md → .meta/hints.md} +0 -0
  37. data/tracks/csharp/exercises/beer-song/{HINTS.md → .meta/hints.md} +0 -0
  38. data/tracks/csharp/exercises/clock/{HINTS.md → .meta/hints.md} +0 -0
  39. data/tracks/csharp/exercises/custom-set/{HINTS.md → .meta/hints.md} +0 -0
  40. data/tracks/csharp/exercises/diamond/{HINTS.md → .meta/hints.md} +0 -0
  41. data/tracks/csharp/exercises/difference-of-squares/{HINTS.md → .meta/hints.md} +0 -0
  42. data/tracks/csharp/exercises/diffie-hellman/{HINTS.md → .meta/hints.md} +0 -0
  43. data/tracks/csharp/exercises/dot-dsl/{HINTS.md → .meta/hints.md} +0 -0
  44. data/tracks/csharp/exercises/food-chain/{HINTS.md → .meta/hints.md} +0 -0
  45. data/tracks/csharp/exercises/forth/{HINTS.md → .meta/hints.md} +0 -0
  46. data/tracks/csharp/exercises/hangman/{HINTS.md → .meta/hints.md} +0 -0
  47. data/tracks/csharp/exercises/house/{HINTS.md → .meta/hints.md} +0 -0
  48. data/tracks/csharp/exercises/list-ops/{HINTS.md → .meta/hints.md} +0 -0
  49. data/tracks/csharp/exercises/markdown/{HINTS.md → .meta/hints.md} +0 -0
  50. data/tracks/csharp/exercises/nth-prime/{HINTS.md → .meta/hints.md} +0 -0
  51. data/tracks/csharp/exercises/nucleotide-count/{HINTS.md → .meta/hints.md} +0 -0
  52. data/tracks/csharp/exercises/palindrome-products/{HINTS.md → .meta/hints.md} +0 -0
  53. data/tracks/csharp/exercises/proverb/{HINTS.md → .meta/hints.md} +0 -0
  54. data/tracks/csharp/exercises/react/{HINTS.md → .meta/hints.md} +0 -0
  55. data/tracks/csharp/exercises/roman-numerals/{HINTS.md → .meta/hints.md} +0 -0
  56. data/tracks/csharp/exercises/saddle-points/{HINTS.md → .meta/hints.md} +0 -0
  57. data/tracks/csharp/exercises/sgf-parsing/{HINTS.md → .meta/hints.md} +0 -0
  58. data/tracks/csharp/exercises/simple-linked-list/{HINTS.md → .meta/hints.md} +0 -0
  59. data/tracks/csharp/exercises/sublist/{HINTS.md → .meta/hints.md} +0 -0
  60. data/tracks/csharp/exercises/sum-of-multiples/{HINTS.md → .meta/hints.md} +0 -0
  61. data/tracks/csharp/exercises/twelve-days/{HINTS.md → .meta/hints.md} +0 -0
  62. data/tracks/csharp/exercises/variable-length-quantity/{HINTS.md → .meta/hints.md} +0 -0
  63. data/tracks/csharp/exercises/word-search/{HINTS.md → .meta/hints.md} +0 -0
  64. data/tracks/csharp/exercises/wordy/{HINTS.md → .meta/hints.md} +0 -0
  65. data/tracks/csharp/exercises/zebra-puzzle/{HINTS.md → .meta/hints.md} +0 -0
  66. data/tracks/csharp/exercises/zipper/{HINTS.md → .meta/hints.md} +0 -0
  67. data/tracks/delphi/exercises/secret-handshake/uTestSecretHandshake.pas +1 -1
  68. data/tracks/elixir/config/exercise_readme.go.tmpl +34 -4
  69. data/tracks/elixir/exercises/accumulate/README.md +1 -6
  70. data/tracks/elixir/exercises/acronym/README.md +1 -4
  71. data/tracks/elixir/exercises/all-your-base/README.md +2 -5
  72. data/tracks/elixir/exercises/allergies/README.md +1 -4
  73. data/tracks/elixir/exercises/anagram/README.md +1 -3
  74. data/tracks/elixir/exercises/atbash-cipher/README.md +3 -4
  75. data/tracks/elixir/exercises/bank-account/README.md +1 -4
  76. data/tracks/elixir/exercises/beer-song/README.md +3 -5
  77. data/tracks/elixir/exercises/binary-search-tree/README.md +43 -0
  78. data/tracks/elixir/exercises/binary-search/README.md +1 -3
  79. data/tracks/elixir/exercises/binary/README.md +3 -3
  80. data/tracks/elixir/exercises/bob/README.md +2 -2
  81. data/tracks/elixir/exercises/bowling/README.md +21 -9
  82. data/tracks/elixir/exercises/bracket-push/README.md +1 -3
  83. data/tracks/elixir/exercises/change/README.md +2 -4
  84. data/tracks/elixir/exercises/clock/README.md +1 -3
  85. data/tracks/elixir/exercises/collatz-conjecture/README.md +2 -4
  86. data/tracks/elixir/exercises/connect/README.md +2 -5
  87. data/tracks/elixir/exercises/crypto-square/README.md +11 -11
  88. data/tracks/elixir/exercises/custom-set/README.md +1 -4
  89. data/tracks/elixir/exercises/diamond/README.md +7 -9
  90. data/tracks/elixir/exercises/difference-of-squares/README.md +1 -3
  91. data/tracks/elixir/exercises/diffie-hellman/{HINTS.md → .meta/hints.md} +0 -0
  92. data/tracks/elixir/exercises/diffie-hellman/README.md +1 -3
  93. data/tracks/elixir/exercises/dominoes/README.md +4 -7
  94. data/tracks/elixir/exercises/dot-dsl/README.md +2 -5
  95. data/tracks/elixir/exercises/etl/README.md +4 -4
  96. data/tracks/elixir/exercises/flatten-array/README.md +2 -5
  97. data/tracks/elixir/exercises/forth/README.md +1 -4
  98. data/tracks/elixir/exercises/gigasecond/README.md +1 -3
  99. data/tracks/elixir/exercises/grade-school/README.md +1 -4
  100. data/tracks/elixir/exercises/grains/README.md +1 -4
  101. data/tracks/elixir/exercises/grep/README.md +13 -15
  102. data/tracks/elixir/exercises/hamming/README.md +1 -3
  103. data/tracks/elixir/exercises/hello-world/README.md +23 -0
  104. data/tracks/elixir/exercises/hexadecimal/README.md +1 -3
  105. data/tracks/elixir/exercises/isbn-verifier/README.md +26 -24
  106. data/tracks/elixir/exercises/isogram/README.md +3 -4
  107. data/tracks/elixir/exercises/kindergarten-garden/README.md +14 -16
  108. data/tracks/elixir/exercises/largest-series-product/README.md +1 -3
  109. data/tracks/elixir/exercises/leap/README.md +2 -4
  110. data/tracks/elixir/exercises/list-ops/README.md +1 -4
  111. data/tracks/elixir/exercises/luhn/README.md +8 -10
  112. data/tracks/elixir/exercises/markdown/README.md +1 -4
  113. data/tracks/elixir/exercises/matrix/README.md +7 -7
  114. data/tracks/elixir/exercises/meetup/README.md +17 -16
  115. data/tracks/elixir/exercises/minesweeper/README.md +1 -4
  116. data/tracks/elixir/exercises/nth-prime/README.md +1 -3
  117. data/tracks/elixir/exercises/nucleotide-count/README.md +9 -25
  118. data/tracks/elixir/exercises/ocr-numbers/README.md +7 -9
  119. data/tracks/elixir/exercises/palindrome-products/README.md +16 -19
  120. data/tracks/elixir/exercises/pangram/README.md +2 -4
  121. data/tracks/elixir/exercises/parallel-letter-frequency/README.md +1 -4
  122. data/tracks/elixir/exercises/pascals-triangle/README.md +3 -5
  123. data/tracks/elixir/exercises/perfect-numbers/README.md +3 -5
  124. data/tracks/elixir/exercises/phone-number/README.md +5 -6
  125. data/tracks/elixir/exercises/pig-latin/README.md +1 -3
  126. data/tracks/elixir/exercises/poker/README.md +1 -3
  127. data/tracks/elixir/exercises/prime-factors/README.md +1 -3
  128. data/tracks/elixir/exercises/protein-translation/README.md +3 -6
  129. data/tracks/elixir/exercises/pythagorean-triplet/README.md +4 -6
  130. data/tracks/elixir/exercises/queen-attack/README.md +2 -4
  131. data/tracks/elixir/exercises/rail-fence-cipher/README.md +13 -10
  132. data/tracks/elixir/exercises/raindrops/README.md +1 -3
  133. data/tracks/elixir/exercises/rna-transcription/README.md +2 -4
  134. data/tracks/elixir/exercises/robot-simulator/README.md +1 -3
  135. data/tracks/elixir/exercises/roman-numerals/README.md +2 -4
  136. data/tracks/elixir/exercises/rotational-cipher/README.md +3 -4
  137. data/tracks/elixir/exercises/run-length-encoding/README.md +5 -7
  138. data/tracks/elixir/exercises/saddle-points/README.md +3 -5
  139. data/tracks/elixir/exercises/say/README.md +1 -3
  140. data/tracks/elixir/exercises/scale-generator/README.md +1 -5
  141. data/tracks/elixir/exercises/scrabble-score/README.md +4 -4
  142. data/tracks/elixir/exercises/secret-handshake/{HINTS.md → .meta/hints.md} +0 -0
  143. data/tracks/elixir/exercises/secret-handshake/README.md +4 -4
  144. data/tracks/elixir/exercises/series/README.md +1 -3
  145. data/tracks/elixir/exercises/sieve/README.md +1 -3
  146. data/tracks/elixir/exercises/simple-cipher/README.md +6 -10
  147. data/tracks/elixir/exercises/simple-linked-list/README.md +1 -3
  148. data/tracks/elixir/exercises/space-age/README.md +2 -4
  149. data/tracks/elixir/exercises/spiral-matrix/README.md +5 -5
  150. data/tracks/elixir/exercises/strain/{HINTS.md → .meta/hints.md} +0 -0
  151. data/tracks/elixir/exercises/strain/README.md +1 -3
  152. data/tracks/elixir/exercises/sublist/README.md +1 -4
  153. data/tracks/elixir/exercises/sum-of-multiples/README.md +4 -9
  154. data/tracks/elixir/exercises/tournament/{HINTS.md → .meta/hints.md} +0 -0
  155. data/tracks/elixir/exercises/tournament/README.md +6 -9
  156. data/tracks/elixir/exercises/transpose/README.md +6 -7
  157. data/tracks/elixir/exercises/triangle/README.md +10 -9
  158. data/tracks/elixir/exercises/twelve-days/README.md +2 -4
  159. data/tracks/elixir/exercises/word-count/README.md +2 -5
  160. data/tracks/elixir/exercises/wordy/README.md +1 -8
  161. data/tracks/elixir/exercises/zipper/README.md +2 -5
  162. data/tracks/fortran/README.md +1 -1
  163. data/tracks/fsharp/config/exercise_readme.go.tmpl +0 -3
  164. data/tracks/fsharp/exercises/accumulate/{HINTS.md → .meta/hints.md} +0 -0
  165. data/tracks/fsharp/exercises/alphametics/{HINTS.md → .meta/hints.md} +0 -0
  166. data/tracks/fsharp/exercises/beer-song/{HINTS.md → .meta/hints.md} +0 -0
  167. data/tracks/fsharp/exercises/diamond/{HINTS.md → .meta/hints.md} +0 -0
  168. data/tracks/fsharp/exercises/difference-of-squares/{HINTS.md → .meta/hints.md} +0 -0
  169. data/tracks/fsharp/exercises/diffie-hellman/{HINTS.md → .meta/hints.md} +0 -0
  170. data/tracks/fsharp/exercises/food-chain/{HINTS.md → .meta/hints.md} +0 -0
  171. data/tracks/fsharp/exercises/gigasecond/{HINTS.md → .meta/hints.md} +0 -0
  172. data/tracks/fsharp/exercises/grade-school/{HINTS.md → .meta/hints.md} +0 -0
  173. data/tracks/fsharp/exercises/grains/{HINTS.md → .meta/hints.md} +0 -0
  174. data/tracks/fsharp/exercises/house/{HINTS.md → .meta/hints.md} +0 -0
  175. data/tracks/fsharp/exercises/lens-person/{HINTS.md → .meta/hints.md} +0 -0
  176. data/tracks/fsharp/exercises/linked-list/{HINTS.md → .meta/hints.md} +0 -0
  177. data/tracks/fsharp/exercises/nth-prime/{HINTS.md → .meta/hints.md} +0 -0
  178. data/tracks/fsharp/exercises/palindrome-products/{HINTS.md → .meta/hints.md} +0 -0
  179. data/tracks/fsharp/exercises/parallel-letter-frequency/{HINTS.md → .meta/hints.md} +0 -0
  180. data/tracks/fsharp/exercises/poker/{HINTS.md → .meta/hints.md} +0 -0
  181. data/tracks/fsharp/exercises/proverb/{HINTS.md → .meta/hints.md} +0 -0
  182. data/tracks/fsharp/exercises/raindrops/{HINTS.md → .meta/hints.md} +0 -0
  183. data/tracks/fsharp/exercises/rna-transcription/{HINTS.md → .meta/hints.md} +0 -0
  184. data/tracks/fsharp/exercises/space-age/{HINTS.md → .meta/hints.md} +0 -0
  185. data/tracks/fsharp/exercises/twelve-days/{HINTS.md → .meta/hints.md} +0 -0
  186. data/tracks/fsharp/exercises/wordy/{HINTS.md → .meta/hints.md} +0 -0
  187. data/tracks/java/exercises/acronym/.meta/version +1 -1
  188. data/tracks/java/exercises/acronym/src/test/java/AcronymTest.java +6 -6
  189. data/tracks/java/exercises/raindrops/.meta/version +1 -0
  190. data/tracks/java/exercises/raindrops/src/test/java/RaindropConverterTest.java +3 -1
  191. data/tracks/java/exercises/transpose/src/test/java/TransposeTest.java +5 -5
  192. data/tracks/java/exercises/word-count/.meta/src/reference/java/WordCount.java +1 -1
  193. data/tracks/java/exercises/word-count/.meta/version +1 -0
  194. data/tracks/java/exercises/word-count/src/test/java/WordCountTest.java +73 -3
  195. data/tracks/mips/config/exercise_readme.go.tmpl +0 -3
  196. data/tracks/perl5/config/exercise_readme.go.tmpl +0 -3
  197. data/tracks/php/exercises/bob/{HINTS.md → .meta/hints.md} +0 -0
  198. data/tracks/php/exercises/roman-numerals/roman-numerals_test.php +1 -1
  199. data/tracks/pony/config/exercise_readme.go.tmpl +0 -3
  200. data/tracks/python/config.json +14 -0
  201. data/tracks/python/exercises/isbn-verifier/README.md +43 -0
  202. data/tracks/python/exercises/isbn-verifier/example.py +8 -0
  203. data/tracks/python/exercises/isbn-verifier/isbn_verifier.py +2 -0
  204. data/tracks/python/exercises/isbn-verifier/isbn_verifier_test.py +54 -0
  205. data/tracks/rust/exercises/atbash-cipher/example.rs +0 -2
  206. data/tracks/rust/exercises/bracket-push/{HINTS.md → .meta/hints.md} +0 -0
  207. data/tracks/rust/exercises/crypto-square/example.rs +0 -2
  208. data/tracks/rust/exercises/etl/example.rs +0 -1
  209. data/tracks/rust/exercises/forth/example.rs +0 -1
  210. data/tracks/rust/exercises/largest-series-product/{HINTS.md → .meta/hints.md} +0 -0
  211. data/tracks/rust/exercises/pangram/example.rs +0 -1
  212. data/tracks/rust/exercises/parallel-letter-frequency/{HINTS.md → .meta/hints.md} +0 -0
  213. data/tracks/rust/exercises/scrabble-score/tests/scrabble-score.rs +9 -2
  214. data/tracks/rust/exercises/space-age/{HINTS.md → .meta/hints.md} +0 -0
  215. data/tracks/rust/exercises/triangle/{HINTS.md → .meta/hints.md} +0 -0
  216. data/tracks/scala/exercises/bank-account/{HINTS.md → .meta/hints.md} +0 -0
  217. data/tracks/scala/exercises/connect/{HINTS.md → .meta/hints.md} +0 -0
  218. data/tracks/scala/exercises/gigasecond/{HINTS.md → .meta/hints.md} +0 -0
  219. data/tracks/scala/exercises/hamming/{HINTS.md → .meta/hints.md} +0 -0
  220. data/tracks/scala/exercises/hello-world/{HINTS.md → .meta/hints.md} +0 -0
  221. data/tracks/scala/exercises/leap/{HINTS.md → .meta/hints.md} +0 -0
  222. data/tracks/scala/exercises/nucleotide-count/{HINTS.md → .meta/hints.md} +0 -0
  223. data/tracks/scala/exercises/parallel-letter-frequency/{HINTS.md → .meta/hints.md} +0 -0
  224. data/tracks/scala/exercises/phone-number/{HINTS.md → .meta/hints.md} +0 -0
  225. data/tracks/scala/exercises/robot-name/{HINTS.md → .meta/hints.md} +0 -0
  226. data/tracks/scala/exercises/roman-numerals/{HINTS.md → .meta/hints.md} +0 -0
  227. data/tracks/scala/exercises/variable-length-quantity/{HINTS.md → .meta/hints.md} +0 -0
  228. metadata +87 -86
  229. data/tracks/elixir/docs/EXERCISE_README_INSERT.md +0 -35
  230. data/tracks/fsharp/docs/EXERCISE_README_INSERT.md +0 -0
  231. data/tracks/mips/docs/EXERCISE_README_INSERT.md +0 -0
  232. data/tracks/perl5/docs/EXERCISE_README_INSERT.md +0 -0
  233. data/tracks/pony/docs/EXERCISE_README_INSERT.md +0 -0
@@ -3,14 +3,14 @@
3
3
  Search a file for lines matching a regular expression pattern. Return the line
4
4
  number and contents of each matching line.
5
5
 
6
- The Unix [`grep`](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html) command can be used to search for lines in one or more files
6
+ The Unix [`grep`](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html) command can be used to search for lines in one or more files
7
7
  that match a user-provided search query (known as the *pattern*).
8
8
 
9
9
  The `grep` command takes three arguments:
10
10
 
11
- 1. The pattern used to match lines in a file.
11
+ 1. The pattern used to match lines in a file.
12
12
  2. Zero or more flags to customize the matching behavior.
13
- 3. One or more files in which to search for matching lines.
13
+ 3. One or more files in which to search for matching lines.
14
14
 
15
15
  Your task is to implement the `grep` function, which should read the contents
16
16
  of the specified files, find the lines that match the specified pattern
@@ -20,18 +20,18 @@ in the first file being output first.
20
20
 
21
21
  As an example, suppose there is a file named "input.txt" with the following contents:
22
22
 
23
- <pre>
23
+ ```text
24
24
  hello
25
25
  world
26
26
  hello again
27
- </pre>
27
+ ```
28
28
 
29
29
  If we were to call `grep "hello" input.txt`, the returned string should be:
30
30
 
31
- <pre>
31
+ ```text
32
32
  hello
33
33
  hello again
34
- </pre>
34
+ ```
35
35
 
36
36
  ### Flags
37
37
 
@@ -46,18 +46,18 @@ As said earlier, the `grep` command should also support the following flags:
46
46
  If we run `grep -n "hello" input.txt`, the `-n` flag will require the matching
47
47
  lines to be prefixed with its line number:
48
48
 
49
- <pre>
49
+ ```text
50
50
  1:hello
51
51
  3:hello again
52
- </pre>
52
+ ```
53
53
 
54
- And if we run `grep -i "HELLO" input.txt`, we'll do a case-insensitive match,
54
+ And if we run `grep -i "HELLO" input.txt`, we'll do a case-insensitive match,
55
55
  and the output will be:
56
56
 
57
- <pre>
57
+ ```text
58
58
  hello
59
59
  hello again
60
- </pre>
60
+ ```
61
61
 
62
62
  The `grep` command should support multiple flags at once.
63
63
 
@@ -69,11 +69,9 @@ print the names of files that do not contain the string "hello".
69
69
  Execute the tests with:
70
70
 
71
71
  ```bash
72
- $ elixir bob_test.exs
72
+ $ elixir grep_test.exs
73
73
  ```
74
74
 
75
- (Replace `bob_test.exs` with the name of the test file.)
76
-
77
75
  ### Pending tests
78
76
 
79
77
  In the test suites, all but the first test have been skipped.
@@ -40,11 +40,9 @@ of equal length differently.
40
40
  Execute the tests with:
41
41
 
42
42
  ```bash
43
- $ elixir bob_test.exs
43
+ $ elixir hamming_test.exs
44
44
  ```
45
45
 
46
- (Replace `bob_test.exs` with the name of the test file.)
47
-
48
46
  ### Pending tests
49
47
 
50
48
  In the test suites, all but the first test have been skipped.
@@ -22,6 +22,29 @@ Execute the tests with:
22
22
  $ elixir hello_world_test.exs
23
23
  ```
24
24
 
25
+ ### Pending tests
26
+
27
+ In the test suites, all but the first test have been skipped.
28
+
29
+ Once you get a test passing, you can unskip the next one by
30
+ commenting out the relevant `@tag :pending` with a `#` symbol.
31
+
32
+ For example:
33
+
34
+ ```elixir
35
+ # @tag :pending
36
+ test "shouting" do
37
+ assert Bob.hey("WATCH OUT!") == "Whoa, chill out!"
38
+ end
39
+ ```
40
+
41
+ Or, you can enable all the tests by commenting out the
42
+ `ExUnit.configure` line in the test suite.
43
+
44
+ ```elixir
45
+ # ExUnit.configure exclude: :pending, trace: true
46
+ ```
47
+
25
48
  For more detailed information about the Elixir track, please
26
49
  see the [help page](http://exercism.io/languages/elixir).
27
50
 
@@ -12,11 +12,9 @@ The program should handle invalid hexadecimal strings.
12
12
  Execute the tests with:
13
13
 
14
14
  ```bash
15
- $ elixir bob_test.exs
15
+ $ elixir hexadecimal_test.exs
16
16
  ```
17
17
 
18
- (Replace `bob_test.exs` with the name of the test file.)
19
-
20
18
  ### Pending tests
21
19
 
22
20
  In the test suites, all but the first test have been skipped.
@@ -1,42 +1,45 @@
1
- # ISBN-Verifier
1
+ # ISBN Verifier
2
2
 
3
- Check if a given ISBN-10 is valid.
3
+ The [ISBN-10 verification process](https://en.wikipedia.org/wiki/International_Standard_Book_Number) is used to validate book identification
4
+ numbers. These normally contain dashes and look like: `3-598-21508-8`
4
5
 
5
- ## Functionality
6
+ ## ISBN
6
7
 
7
- Given an unknown string the program should check if the provided string is a valid ISBN-10.
8
- Putting this into place requires some thinking about preprocessing/parsing of the string prior to calculating the check digit for the ISBN.
8
+ The ISBN-10 format is 9 digits (0 to 9) plus one check character (either a digit or an X only). In the case the check character is an X, this represents the value '10'. These may be communicated with or without hyphens, and can be checked for their validity by the following formula:
9
9
 
10
- The program should allow for ISBN-10 without the separating dashes to be verified as well.
10
+ ```
11
+ (x1 * 10 + x2 * 9 + x3 * 8 + x4 * 7 + x5 * 6 + x6 * 5 + x7 * 4 + x8 * 3 + x9 * 2 + x10 * 1) mod 11 == 0
12
+ ```
11
13
 
12
- ## ISBN
14
+ If the result is 0, then it is a valid ISBN-10, otherwise it is invalid.
15
+
16
+ ## Example
17
+
18
+ Let's take the ISBN-10 `3-598-21508-8`. We plug it in to the formula, and get:
19
+ ```
20
+ (3 * 10 + 5 * 9 + 9 * 8 + 8 * 7 + 2 * 6 + 1 * 5 + 5 * 4 + 0 * 3 + 8 * 2 + 8 * 1) mod 11 == 0
21
+ ```
13
22
 
14
- Let's take a random ISBN-10 number, say `3-598-21508-8` for this.
15
- The first digit block indicates the group where the ISBN belongs. Groups can consist of shared languages, geographic regions or countries. The leading '3' signals this ISBN is from a german speaking country.
16
- The following number block is to identify the publisher. Since this is a three digit publisher number there is a 5 digit title number for this book.
17
- The last digit in the ISBN is the check digit which is used to detect read errors.
23
+ Since the result is 0, this proves that our ISBN is valid.
18
24
 
19
- The first 9 digits in the ISBN have to be between 0 and 9.
20
- The check digit can additionally be an 'X' to allow 10 to be a valid check digit as well.
25
+ ## Task
26
+
27
+ Given a string the program should check if the provided string is a valid ISBN-10.
28
+ Putting this into place requires some thinking about preprocessing/parsing of the string prior to calculating the check digit for the ISBN.
21
29
 
22
- A valid ISBN-10 is calculated with this formula `(x1 * 10 + x2 * 9 + x3 * 8 + x4 * 7 + x5 * 6 + x6 * 5 + x7 * 4 + x8 * 3 + x9 * 2 + x10 * 1) mod 11 == 0`
23
- So for our example ISBN this means:
24
- (3 * 10 + 5 * 9 + 9 * 8 + 8 * 7 + 2 * 6 + 1 * 5 + 5 * 4 + 0 * 3 + 8 * 2 + 8 * 1) mod 11 = 0
30
+ The program should be able to verify ISBN-10 both with and without separating dashes.
25
31
 
26
- Which proves that the ISBN is valid.
27
32
 
28
33
  ## Caveats
29
34
 
30
- Converting from string to number can be tricky in certain languages.
31
- It's getting even trickier since the check-digit of an ISBN-10 can be 'X'.
35
+ Converting from strings to numbers can be tricky in certain languages.
36
+ Now, it's even trickier since the check digit of an ISBN-10 may be 'X' (representing '10'). For instance `3-598-21507-X` is a valid ISBN-10.
32
37
 
33
38
  ## Bonus tasks
34
39
 
35
- * Generate a valid ISBN-13 from the input ISBN-10 (and maybe verify it again with a derived verifier)
36
-
37
- * Generate valid ISBN, maybe even from a given starting ISBN
38
-
40
+ * Generate a valid ISBN-13 from the input ISBN-10 (and maybe verify it again with a derived verifier).
39
41
 
42
+ * Generate valid ISBN, maybe even from a given starting ISBN.
40
43
  ## Running tests
41
44
 
42
45
  Execute the tests with:
@@ -45,7 +48,6 @@ Execute the tests with:
45
48
  $ elixir isbn_verifier_test.exs
46
49
  ```
47
50
 
48
-
49
51
  ### Pending tests
50
52
 
51
53
  In the test suites, all but the first test have been skipped.
@@ -2,13 +2,14 @@
2
2
 
3
3
  Determine if a word or phrase is an isogram.
4
4
 
5
- An isogram (also known as a "nonpattern word") is a word or phrase without a repeating letter.
5
+ An isogram (also known as a "nonpattern word") is a word or phrase without a repeating letter, however spaces and hyphens are allowed to appear multiple times.
6
6
 
7
7
  Examples of isograms:
8
8
 
9
9
  - lumberjacks
10
10
  - background
11
11
  - downstream
12
+ - six-year-old
12
13
 
13
14
  The word *isograms*, however, is not an isogram, because the s repeats.
14
15
 
@@ -17,11 +18,9 @@ The word *isograms*, however, is not an isogram, because the s repeats.
17
18
  Execute the tests with:
18
19
 
19
20
  ```bash
20
- $ elixir bob_test.exs
21
+ $ elixir isogram_test.exs
21
22
  ```
22
23
 
23
- (Replace `bob_test.exs` with the name of the test file.)
24
-
25
24
  ### Pending tests
26
25
 
27
26
  In the test suites, all but the first test have been skipped.
@@ -3,19 +3,19 @@
3
3
  Given a diagram, determine which plants each child in the kindergarten class is
4
4
  responsible for.
5
5
 
6
- The kindergarten class is learning about growing plants. The teachers
6
+ The kindergarten class is learning about growing plants. The teacher
7
7
  thought it would be a good idea to give them actual seeds, plant them in
8
8
  actual dirt, and grow actual plants.
9
9
 
10
10
  They've chosen to grow grass, clover, radishes, and violets.
11
11
 
12
- To this end, they've put little styrofoam cups along the window sills,
13
- and planted one type of plant in each cup, choosing randomly from the
14
- available types of seeds.
12
+ To this end, the children have put little cups along the window sills, and
13
+ planted one type of plant in each cup, choosing randomly from the available
14
+ types of seeds.
15
15
 
16
- ```plain
16
+ ```text
17
17
  [window][window][window]
18
- ........................ # each dot represents a styrofoam cup
18
+ ........................ # each dot represents a cup
19
19
  ........................
20
20
  ```
21
21
 
@@ -25,27 +25,27 @@ There are 12 children in the class:
25
25
  - Eve, Fred, Ginny, Harriet,
26
26
  - Ileana, Joseph, Kincaid, and Larry.
27
27
 
28
- Each child gets 4 cups, two on each row. The children are assigned to
29
- cups in alphabetical order.
28
+ Each child gets 4 cups, two on each row. Their teacher assigns cups to
29
+ the children alphabetically by their names.
30
30
 
31
31
  The following diagram represents Alice's plants:
32
32
 
33
- ```plain
33
+ ```text
34
34
  [window][window][window]
35
35
  VR......................
36
36
  RG......................
37
37
  ```
38
38
 
39
- So in the row nearest the window, she has a violet and a radish; in the
40
- row behind that, she has a radish and some grass.
39
+ In the first row, nearest the windows, she has a violet and a radish. In the
40
+ second row she has a radish and some grass.
41
41
 
42
42
  Your program will be given the plants from left-to-right starting with
43
43
  the row nearest the windows. From this, it should be able to determine
44
- which plants belong to which students.
44
+ which plants belong to each student.
45
45
 
46
46
  For example, if it's told that the garden looks like so:
47
47
 
48
- ```plain
48
+ ```text
49
49
  [window][window][window]
50
50
  VRCGVVRVCGGCCGVRGCVCGCGV
51
51
  VRCCCGCRRGVCGCRVVCVGCGCV
@@ -64,11 +64,9 @@ While asking for Bob's plants would yield:
64
64
  Execute the tests with:
65
65
 
66
66
  ```bash
67
- $ elixir bob_test.exs
67
+ $ elixir kindergarten_garden_test.exs
68
68
  ```
69
69
 
70
- (Replace `bob_test.exs` with the name of the test file.)
71
-
72
70
  ### Pending tests
73
71
 
74
72
  In the test suites, all but the first test have been skipped.
@@ -18,11 +18,9 @@ the largest product for a series of 6 digits is 23520.
18
18
  Execute the tests with:
19
19
 
20
20
  ```bash
21
- $ elixir bob_test.exs
21
+ $ elixir largest_series_product_test.exs
22
22
  ```
23
23
 
24
- (Replace `bob_test.exs` with the name of the test file.)
25
-
26
24
  ### Pending tests
27
25
 
28
26
  In the test suites, all but the first test have been skipped.
@@ -4,7 +4,7 @@ Given a year, report if it is a leap year.
4
4
 
5
5
  The tricky thing here is that a leap year in the Gregorian calendar occurs:
6
6
 
7
- ```plain
7
+ ```text
8
8
  on every year that is evenly divisible by 4
9
9
  except every year that is evenly divisible by 100
10
10
  unless the year is also evenly divisible by 400
@@ -31,11 +31,9 @@ phenomenon, go watch [this youtube video][video].
31
31
  Execute the tests with:
32
32
 
33
33
  ```bash
34
- $ elixir bob_test.exs
34
+ $ elixir leap_test.exs
35
35
  ```
36
36
 
37
- (Replace `bob_test.exs` with the name of the test file.)
38
-
39
37
  ### Pending tests
40
38
 
41
39
  In the test suites, all but the first test have been skipped.
@@ -11,11 +11,9 @@ without using existing functions.
11
11
  Execute the tests with:
12
12
 
13
13
  ```bash
14
- $ elixir bob_test.exs
14
+ $ elixir list_ops_test.exs
15
15
  ```
16
16
 
17
- (Replace `bob_test.exs` with the name of the test file.)
18
-
19
17
  ### Pending tests
20
18
 
21
19
  In the test suites, all but the first test have been skipped.
@@ -42,6 +40,5 @@ Or, you can enable all the tests by commenting out the
42
40
  For more detailed information about the Elixir track, please
43
41
  see the [help page](http://exercism.io/languages/elixir).
44
42
 
45
-
46
43
  ## Submitting Incomplete Solutions
47
44
  It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -18,27 +18,27 @@ are disallowed.
18
18
 
19
19
  ## Example 1: valid credit card number
20
20
 
21
- ```
21
+ ```text
22
22
  4539 1488 0343 6467
23
23
  ```
24
24
 
25
25
  The first step of the Luhn algorithm is to double every second digit,
26
26
  starting from the right. We will be doubling
27
27
 
28
- ```
28
+ ```text
29
29
  4_3_ 1_8_ 0_4_ 6_6_
30
30
  ```
31
31
 
32
32
  If doubling the number results in a number greater than 9 then subtract 9
33
33
  from the product. The results of our doubling:
34
34
 
35
- ```
35
+ ```text
36
36
  8569 2478 0383 3437
37
37
  ```
38
38
 
39
39
  Then sum all of the digits:
40
40
 
41
- ```
41
+ ```text
42
42
  8+5+6+9+2+4+7+8+0+3+8+3+3+4+3+7 = 80
43
43
  ```
44
44
 
@@ -46,19 +46,19 @@ If the sum is evenly divisible by 10, then the number is valid. This number is v
46
46
 
47
47
  ## Example 2: invalid credit card number
48
48
 
49
- ```
49
+ ```text
50
50
  8273 1232 7352 0569
51
51
  ```
52
52
 
53
53
  Double the second digits, starting from the right
54
54
 
55
- ```
55
+ ```text
56
56
  7253 2262 5312 0539
57
57
  ```
58
58
 
59
59
  Sum the digits
60
60
 
61
- ```
61
+ ```text
62
62
  7+2+5+3+2+2+6+2+5+3+1+2+0+5+3+9 = 57
63
63
  ```
64
64
 
@@ -69,11 +69,9 @@ Sum the digits
69
69
  Execute the tests with:
70
70
 
71
71
  ```bash
72
- $ elixir bob_test.exs
72
+ $ elixir luhn_test.exs
73
73
  ```
74
74
 
75
- (Replace `bob_test.exs` with the name of the test file.)
76
-
77
75
  ### Pending tests
78
76
 
79
77
  In the test suites, all but the first test have been skipped.
@@ -19,11 +19,9 @@ important thing is to make the code better!
19
19
  Execute the tests with:
20
20
 
21
21
  ```bash
22
- $ elixir bob_test.exs
22
+ $ elixir markdown_test.exs
23
23
  ```
24
24
 
25
- (Replace `bob_test.exs` with the name of the test file.)
26
-
27
25
  ### Pending tests
28
26
 
29
27
  In the test suites, all but the first test have been skipped.
@@ -50,6 +48,5 @@ Or, you can enable all the tests by commenting out the
50
48
  For more detailed information about the Elixir track, please
51
49
  see the [help page](http://exercism.io/languages/elixir).
52
50
 
53
-
54
51
  ## Submitting Incomplete Solutions
55
52
  It's possible to submit an incomplete solution so you can see how others have completed the exercise.