trackler 2.2.1.59 → 2.2.1.60

Sign up to get free protection for your applications and to get access to all the features.
Files changed (234) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/exercises/food-chain/canonical-data.json +31 -23
  4. data/problem-specifications/exercises/house/canonical-data.json +45 -33
  5. data/problem-specifications/exercises/house/description.md +1 -1
  6. data/problem-specifications/exercises/kindergarten-garden/description.md +3 -3
  7. data/problem-specifications/exercises/nucleotide-count/description.md +2 -2
  8. data/problem-specifications/exercises/palindrome-products/description.md +1 -1
  9. data/problem-specifications/exercises/rectangles/description.md +9 -9
  10. data/problem-specifications/exercises/twelve-days/canonical-data.json +171 -0
  11. data/problem-specifications/exercises/two-bucket/description.md +7 -7
  12. data/tracks/c/docs/CONTRIBUTING.md +88 -39
  13. data/tracks/c/exercises/phone-number/test/test_phone_number.c +33 -29
  14. data/tracks/c/exercises/triangle/src/example.c +12 -12
  15. data/tracks/c/exercises/triangle/src/example.h +3 -3
  16. data/tracks/c/exercises/triangle/test/test_triangle.c +16 -16
  17. data/tracks/c/exercises/word-count/src/example.c +12 -3
  18. data/tracks/c/exercises/word-count/src/word_count.h +10 -5
  19. data/tracks/c/exercises/word-count/test/test_word_count.c +248 -58
  20. data/tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon +3 -3
  21. data/tracks/ceylon/exercises/leap/source/leap/LeapTest.ceylon +2 -2
  22. data/tracks/dart/exercises/phone-number/README.md +1 -1
  23. data/tracks/dart/exercises/phone-number/test/phone_number_test.dart +5 -5
  24. data/tracks/gnu-apl/.dockerignore +5 -0
  25. data/tracks/gnu-apl/.travis.yml +9 -4
  26. data/tracks/gnu-apl/Dockerfiles/release.dockerfile +15 -0
  27. data/tracks/gnu-apl/Dockerfiles/svn.dockerfile +22 -0
  28. data/tracks/gnu-apl/README.md +1 -1
  29. data/tracks/gnu-apl/bin/install-apl +26 -0
  30. data/tracks/gnu-apl/test.apl +7 -6
  31. data/tracks/go/docs/TESTS.md +1 -1
  32. data/tracks/haskell/.travis.yml +1 -1
  33. data/tracks/haskell/config.json +9 -0
  34. data/tracks/haskell/exercises/accumulate/stack.yaml +1 -1
  35. data/tracks/haskell/exercises/acronym/package.yaml +1 -1
  36. data/tracks/haskell/exercises/acronym/stack.yaml +1 -1
  37. data/tracks/haskell/exercises/acronym/test/Tests.hs +3 -0
  38. data/tracks/haskell/exercises/all-your-base/stack.yaml +1 -1
  39. data/tracks/haskell/exercises/allergies/stack.yaml +1 -1
  40. data/tracks/haskell/exercises/alphametics/examples/success-standard/src/Alphametics.hs +2 -1
  41. data/tracks/haskell/exercises/alphametics/stack.yaml +1 -1
  42. data/tracks/haskell/exercises/anagram/stack.yaml +1 -1
  43. data/tracks/haskell/exercises/atbash-cipher/stack.yaml +1 -1
  44. data/tracks/haskell/exercises/bank-account/stack.yaml +1 -1
  45. data/tracks/haskell/exercises/beer-song/stack.yaml +1 -1
  46. data/tracks/haskell/exercises/binary-search-tree/stack.yaml +1 -1
  47. data/tracks/haskell/exercises/binary/stack.yaml +1 -1
  48. data/tracks/haskell/exercises/bob/stack.yaml +1 -1
  49. data/tracks/haskell/exercises/bowling/stack.yaml +1 -1
  50. data/tracks/haskell/exercises/bracket-push/stack.yaml +1 -1
  51. data/tracks/haskell/exercises/change/stack.yaml +1 -1
  52. data/tracks/haskell/exercises/clock/stack.yaml +1 -1
  53. data/tracks/haskell/exercises/collatz-conjecture/stack.yaml +1 -1
  54. data/tracks/haskell/exercises/complex-numbers/stack.yaml +1 -1
  55. data/tracks/haskell/exercises/connect/stack.yaml +1 -1
  56. data/tracks/haskell/exercises/crypto-square/package.yaml +1 -1
  57. data/tracks/haskell/exercises/crypto-square/stack.yaml +1 -1
  58. data/tracks/haskell/exercises/crypto-square/test/Tests.hs +9 -5
  59. data/tracks/haskell/exercises/custom-set/package.yaml +1 -1
  60. data/tracks/haskell/exercises/custom-set/stack.yaml +1 -1
  61. data/tracks/haskell/exercises/custom-set/test/Tests.hs +3 -0
  62. data/tracks/haskell/exercises/diamond/stack.yaml +1 -1
  63. data/tracks/haskell/exercises/difference-of-squares/stack.yaml +1 -1
  64. data/tracks/haskell/exercises/dominoes/README.md +3 -3
  65. data/tracks/haskell/exercises/dominoes/stack.yaml +1 -1
  66. data/tracks/haskell/exercises/etl/stack.yaml +1 -1
  67. data/tracks/haskell/exercises/food-chain/stack.yaml +1 -1
  68. data/tracks/haskell/exercises/forth/stack.yaml +1 -1
  69. data/tracks/haskell/exercises/gigasecond/stack.yaml +1 -1
  70. data/tracks/haskell/exercises/go-counting/stack.yaml +1 -1
  71. data/tracks/haskell/exercises/grade-school/stack.yaml +1 -1
  72. data/tracks/haskell/exercises/grains/stack.yaml +1 -1
  73. data/tracks/haskell/exercises/hamming/package.yaml +1 -1
  74. data/tracks/haskell/exercises/hamming/stack.yaml +1 -1
  75. data/tracks/haskell/exercises/hamming/test/Tests.hs +4 -4
  76. data/tracks/haskell/exercises/hello-world/stack.yaml +1 -1
  77. data/tracks/haskell/exercises/hexadecimal/stack.yaml +1 -1
  78. data/tracks/haskell/exercises/house/README.md +1 -1
  79. data/tracks/haskell/exercises/house/stack.yaml +1 -1
  80. data/tracks/haskell/exercises/isbn-verifier/README.md +96 -0
  81. data/tracks/haskell/exercises/isbn-verifier/examples/success-standard/package.yaml +16 -0
  82. data/tracks/haskell/exercises/isbn-verifier/examples/success-standard/src/IsbnVerifier.hs +10 -0
  83. data/tracks/haskell/exercises/isbn-verifier/package.yaml +20 -0
  84. data/tracks/haskell/exercises/isbn-verifier/src/IsbnVerifier.hs +4 -0
  85. data/tracks/haskell/exercises/isbn-verifier/stack.yaml +1 -0
  86. data/tracks/haskell/exercises/isbn-verifier/test/Tests.hs +74 -0
  87. data/tracks/haskell/exercises/isogram/stack.yaml +1 -1
  88. data/tracks/haskell/exercises/kindergarten-garden/README.md +3 -3
  89. data/tracks/haskell/exercises/kindergarten-garden/stack.yaml +1 -1
  90. data/tracks/haskell/exercises/largest-series-product/stack.yaml +1 -1
  91. data/tracks/haskell/exercises/leap/package.yaml +1 -1
  92. data/tracks/haskell/exercises/leap/stack.yaml +1 -1
  93. data/tracks/haskell/exercises/leap/test/Tests.hs +1 -1
  94. data/tracks/haskell/exercises/lens-person/stack.yaml +1 -1
  95. data/tracks/haskell/exercises/linked-list/stack.yaml +1 -1
  96. data/tracks/haskell/exercises/list-ops/stack.yaml +1 -1
  97. data/tracks/haskell/exercises/luhn/stack.yaml +1 -1
  98. data/tracks/haskell/exercises/matrix/stack.yaml +1 -1
  99. data/tracks/haskell/exercises/meetup/stack.yaml +1 -1
  100. data/tracks/haskell/exercises/minesweeper/stack.yaml +1 -1
  101. data/tracks/haskell/exercises/nth-prime/package.yaml +1 -1
  102. data/tracks/haskell/exercises/nth-prime/stack.yaml +1 -1
  103. data/tracks/haskell/exercises/nucleotide-count/README.md +2 -2
  104. data/tracks/haskell/exercises/nucleotide-count/package.yaml +1 -1
  105. data/tracks/haskell/exercises/nucleotide-count/stack.yaml +1 -1
  106. data/tracks/haskell/exercises/nucleotide-count/test/Tests.hs +6 -0
  107. data/tracks/haskell/exercises/ocr-numbers/stack.yaml +1 -1
  108. data/tracks/haskell/exercises/octal/stack.yaml +1 -1
  109. data/tracks/haskell/exercises/palindrome-products/README.md +1 -1
  110. data/tracks/haskell/exercises/palindrome-products/stack.yaml +1 -1
  111. data/tracks/haskell/exercises/pangram/package.yaml +1 -1
  112. data/tracks/haskell/exercises/pangram/stack.yaml +1 -1
  113. data/tracks/haskell/exercises/pangram/test/Tests.hs +6 -2
  114. data/tracks/haskell/exercises/parallel-letter-frequency/stack.yaml +1 -1
  115. data/tracks/haskell/exercises/pascals-triangle/stack.yaml +1 -1
  116. data/tracks/haskell/exercises/perfect-numbers/stack.yaml +1 -1
  117. data/tracks/haskell/exercises/phone-number/README.md +1 -1
  118. data/tracks/haskell/exercises/phone-number/stack.yaml +1 -1
  119. data/tracks/haskell/exercises/pig-latin/stack.yaml +1 -1
  120. data/tracks/haskell/exercises/pov/stack.yaml +1 -1
  121. data/tracks/haskell/exercises/prime-factors/stack.yaml +1 -1
  122. data/tracks/haskell/exercises/pythagorean-triplet/stack.yaml +1 -1
  123. data/tracks/haskell/exercises/queen-attack/stack.yaml +1 -1
  124. data/tracks/haskell/exercises/raindrops/stack.yaml +1 -1
  125. data/tracks/haskell/exercises/rna-transcription/stack.yaml +1 -1
  126. data/tracks/haskell/exercises/robot-name/stack.yaml +1 -1
  127. data/tracks/haskell/exercises/robot-simulator/stack.yaml +1 -1
  128. data/tracks/haskell/exercises/roman-numerals/stack.yaml +1 -1
  129. data/tracks/haskell/exercises/rotational-cipher/stack.yaml +1 -1
  130. data/tracks/haskell/exercises/run-length-encoding/stack.yaml +1 -1
  131. data/tracks/haskell/exercises/saddle-points/stack.yaml +1 -1
  132. data/tracks/haskell/exercises/say/stack.yaml +1 -1
  133. data/tracks/haskell/exercises/scrabble-score/stack.yaml +1 -1
  134. data/tracks/haskell/exercises/secret-handshake/stack.yaml +1 -1
  135. data/tracks/haskell/exercises/series/stack.yaml +1 -1
  136. data/tracks/haskell/exercises/sgf-parsing/stack.yaml +1 -1
  137. data/tracks/haskell/exercises/sieve/stack.yaml +1 -1
  138. data/tracks/haskell/exercises/simple-cipher/stack.yaml +1 -1
  139. data/tracks/haskell/exercises/simple-linked-list/stack.yaml +1 -1
  140. data/tracks/haskell/exercises/space-age/stack.yaml +1 -1
  141. data/tracks/haskell/exercises/spiral-matrix/stack.yaml +1 -1
  142. data/tracks/haskell/exercises/strain/stack.yaml +1 -1
  143. data/tracks/haskell/exercises/sublist/stack.yaml +1 -1
  144. data/tracks/haskell/exercises/sum-of-multiples/stack.yaml +1 -1
  145. data/tracks/haskell/exercises/triangle/stack.yaml +1 -1
  146. data/tracks/haskell/exercises/trinary/stack.yaml +1 -1
  147. data/tracks/haskell/exercises/word-count/stack.yaml +1 -1
  148. data/tracks/haskell/exercises/wordy/examples/success-standard/src/WordProblem.hs +6 -5
  149. data/tracks/haskell/exercises/wordy/stack.yaml +1 -1
  150. data/tracks/haskell/exercises/zebra-puzzle/package.yaml +1 -1
  151. data/tracks/haskell/exercises/zebra-puzzle/stack.yaml +1 -1
  152. data/tracks/haskell/exercises/zipper/README.md +1 -1
  153. data/tracks/haskell/exercises/zipper/stack.yaml +1 -1
  154. data/tracks/javascript/.eslintignore +43 -0
  155. data/tracks/javascript/.travis.yml +2 -1
  156. data/tracks/javascript/exercises/bowling/README.md +5 -5
  157. data/tracks/javascript/exercises/crypto-square/example.js +2 -1
  158. data/tracks/javascript/exercises/diffie-hellman/diffie-hellman.spec.js +20 -20
  159. data/tracks/javascript/exercises/diffie-hellman/example.js +10 -10
  160. data/tracks/javascript/exercises/largest-series-product/example.js +2 -1
  161. data/tracks/javascript/exercises/sieve/example.js +5 -2
  162. data/tracks/javascript/package-lock.json +129 -76
  163. data/tracks/javascript/package.json +6 -5
  164. data/tracks/ocaml/config.json +10 -0
  165. data/tracks/ocaml/exercises/hamming/test.ml +3 -3
  166. data/tracks/ocaml/exercises/leap/test.ml +2 -2
  167. data/tracks/ocaml/exercises/pangram/test.ml +3 -3
  168. data/tracks/ocaml/exercises/rectangles/.merlin +5 -0
  169. data/tracks/ocaml/exercises/rectangles/Makefile +11 -0
  170. data/tracks/ocaml/exercises/rectangles/example.ml +30 -0
  171. data/tracks/ocaml/exercises/rectangles/rectangles.mli +1 -0
  172. data/tracks/ocaml/exercises/rectangles/test.ml +72 -0
  173. data/tracks/ocaml/tools/test-generator/templates/ocaml/leap/test.ml +1 -1
  174. data/tracks/ocaml/tools/test-generator/templates/ocaml/rectangles/test.ml +15 -0
  175. data/tracks/pony/README.md +1 -1
  176. data/tracks/pony/exercises/atbash-cipher/example.pony +6 -10
  177. data/tracks/pony/exercises/difference-of-squares/example.pony +3 -7
  178. data/tracks/rust/_test/count-ignores.sh +2 -2
  179. data/tracks/rust/config.json +24 -0
  180. data/tracks/rust/config/maintainers.json +10 -0
  181. data/tracks/rust/exercises/acronym/README.md +0 -1
  182. data/tracks/rust/exercises/all-your-base/README.md +1 -1
  183. data/tracks/rust/exercises/allergies/README.md +0 -1
  184. data/tracks/rust/exercises/alphametics/README.md +2 -2
  185. data/tracks/rust/exercises/atbash-cipher/README.md +2 -1
  186. data/tracks/rust/exercises/beer-song/README.md +1 -1
  187. data/tracks/rust/exercises/bowling/README.md +20 -6
  188. data/tracks/rust/exercises/circular-buffer/README.md +13 -6
  189. data/tracks/rust/exercises/crypto-square/README.md +10 -8
  190. data/tracks/rust/exercises/dominoes/Cargo.toml +1 -1
  191. data/tracks/rust/exercises/etl/README.md +2 -0
  192. data/tracks/rust/exercises/grade-school/README.md +0 -1
  193. data/tracks/rust/exercises/grains/README.md +0 -1
  194. data/tracks/rust/exercises/isbn-verifier/Cargo.lock +4 -0
  195. data/tracks/rust/exercises/isbn-verifier/Cargo.toml +3 -0
  196. data/tracks/rust/exercises/isbn-verifier/README.md +74 -0
  197. data/tracks/rust/exercises/isbn-verifier/example.rs +44 -0
  198. data/tracks/rust/exercises/isbn-verifier/src/lib.rs +4 -0
  199. data/tracks/rust/exercises/isbn-verifier/tests/isbn-verifier.rs +83 -0
  200. data/tracks/rust/exercises/isogram/README.md +3 -2
  201. data/tracks/rust/exercises/leap/README.md +1 -1
  202. data/tracks/rust/exercises/luhn/README.md +7 -7
  203. data/tracks/rust/exercises/nucleotide-count/README.md +8 -22
  204. data/tracks/rust/exercises/ocr-numbers/README.md +5 -5
  205. data/tracks/rust/exercises/pangram/README.md +1 -1
  206. data/tracks/rust/exercises/pascals-triangle/README.md +1 -1
  207. data/tracks/rust/exercises/perfect-numbers/README.md +2 -2
  208. data/tracks/rust/exercises/phone-number/README.md +3 -2
  209. data/tracks/rust/exercises/protein-translation/README.md +4 -5
  210. data/tracks/rust/exercises/proverb/README.md +13 -11
  211. data/tracks/rust/exercises/proverb/example.rs +14 -15
  212. data/tracks/rust/exercises/proverb/tests/proverb.rs +40 -13
  213. data/tracks/rust/exercises/pythagorean-triplet/README.md +3 -3
  214. data/tracks/rust/exercises/queen-attack/README.md +1 -1
  215. data/tracks/rust/exercises/rectangles/README.md +7 -7
  216. data/tracks/rust/exercises/roman-numerals/README.md +1 -1
  217. data/tracks/rust/exercises/rotational-cipher/README.md +2 -1
  218. data/tracks/rust/exercises/run-length-encoding/README.md +4 -4
  219. data/tracks/rust/exercises/scrabble-score/README.md +3 -1
  220. data/tracks/rust/exercises/space-age/README.md +1 -1
  221. data/tracks/rust/exercises/tournament/README.md +5 -5
  222. data/tracks/rust/exercises/triangle/README.md +9 -6
  223. data/tracks/rust/exercises/two-bucket/Cargo.lock +4 -0
  224. data/tracks/rust/exercises/two-bucket/Cargo.toml +3 -0
  225. data/tracks/rust/exercises/two-bucket/README.md +69 -0
  226. data/tracks/rust/exercises/two-bucket/example.rs +129 -0
  227. data/tracks/rust/exercises/two-bucket/src/lib.rs +26 -0
  228. data/tracks/rust/exercises/two-bucket/tests/two-bucket.rs +68 -0
  229. data/tracks/rust/exercises/variable-length-quantity/README.md +6 -7
  230. data/tracks/rust/exercises/word-count/README.md +1 -2
  231. data/tracks/rust/exercises/wordy/README.md +0 -5
  232. metadata +33 -4
  233. data/tracks/go/.github/PULL_REQUEST_TEMPLATE.md +0 -23
  234. data/tracks/ruby/.github/PULL_REQUEST_TEMPLATE.md +0 -40
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -23,6 +23,12 @@ specs = do
23
23
  , ('G', 0)
24
24
  , ('T', 0) ]
25
25
 
26
+ it "can count one nucleotide in single-character input" $
27
+ nucleotideCounts "G" `matchesMap` [ ('A', 0)
28
+ , ('C', 0)
29
+ , ('G', 1)
30
+ , ('T', 0) ]
31
+
26
32
  it "repetitive-sequence-has-only-guanosine" $
27
33
  nucleotideCounts "GGGGGGGG" `matchesMap` [ ('A', 0)
28
34
  , ('C', 0)
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -9,7 +9,7 @@ Given a range of numbers, find the largest and smallest palindromes which
9
9
  are products of numbers within that range.
10
10
 
11
11
  Your solution should return the largest and smallest palindromes, along with the
12
- factors of each within the range. If the largest or smallest palindrome has more
12
+ factors of each within the range. If the largest or smallest palindrome has more
13
13
  than one pair of factors within the range, then return all the pairs.
14
14
 
15
15
  ## Example 1
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1,5 +1,5 @@
1
1
  name: pangram
2
- version: 1.1.0.3
2
+ version: 1.3.0.5
3
3
 
4
4
  dependencies:
5
5
  - base
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -24,6 +24,10 @@ cases = [ Case { description = "sentence empty"
24
24
  , input = ""
25
25
  , expected = False
26
26
  }
27
+ , Case { description = "recognizes a perfect lower case pangram"
28
+ , input = "abcdefghijklmnopqrstuvwxyz"
29
+ , expected = True
30
+ }
27
31
  , Case { description = "pangram with only lower case"
28
32
  , input = "the quick brown fox jumps over the lazy dog"
29
33
  , expected = True
@@ -32,8 +36,8 @@ cases = [ Case { description = "sentence empty"
32
36
  , input = "a quick movement of the enemy will jeopardize five gunboats"
33
37
  , expected = False
34
38
  }
35
- , Case { description = "another missing character 'x'"
36
- , input = "the quick brown fish jumps over the lazy dog"
39
+ , Case { description = "another missing character, e.g. 'h'"
40
+ , input = "five boxing wizards jump quickly at it"
37
41
  , expected = False
38
42
  }
39
43
  , Case { description = "pangram with underscores"
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -14,7 +14,7 @@ The format is usually represented as
14
14
 
15
15
  where `N` is any digit from 2 through 9 and `X` is any digit from 0 through 9.
16
16
 
17
- Your task is to clean up differently formated telephone numbers by removing punctuation and the country code (1) if present.
17
+ Your task is to clean up differently formatted telephone numbers by removing punctuation and the country code (1) if present.
18
18
 
19
19
  For example, the inputs
20
20
  - `+1 (613)-995-0253`
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1,5 +1,6 @@
1
1
  {-# LANGUAGE OverloadedStrings #-}
2
2
  module WordProblem (answer) where
3
+ import Data.Functor (($>))
3
4
  import Data.Text (pack)
4
5
  import Data.List (foldl')
5
6
  import Control.Applicative ((<|>))
@@ -10,7 +11,7 @@ answerParser :: Parser Int
10
11
  answerParser = do
11
12
  n <- "What is " *> signed decimal
12
13
  ops <- many' (space *> operation)
13
- "?" *> pure (foldl' (flip ($)) n ops)
14
+ "?" $> foldl' (flip ($)) n ops
14
15
 
15
16
  answer :: String -> Maybe Int
16
17
  answer = maybeResult . parse answerParser . pack
@@ -19,7 +20,7 @@ operation :: Parser (Int -> Int)
19
20
  operation = (flip <$> operator) <* space <*> signed decimal
20
21
 
21
22
  operator :: Parser (Int -> Int -> Int)
22
- operator = "plus" *> pure (+) <|>
23
- "minus" *> pure (-) <|>
24
- "multiplied by" *> pure (*) <|>
25
- "divided by" *> pure div
23
+ operator = "plus" $> (+) <|>
24
+ "minus" $> (-) <|>
25
+ "multiplied by" $> (*) <|>
26
+ "divided by" $> div
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1,5 +1,5 @@
1
1
  name: zebra-puzzle
2
- version: 0.1.0.2
2
+ version: 1.0.0.3
3
3
 
4
4
  dependencies:
5
5
  - base
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -3,7 +3,7 @@
3
3
  Creating a zipper for a binary tree.
4
4
 
5
5
  [Zippers](https://en.wikipedia.org/wiki/Zipper_%28data_structure%29) are
6
- a way purely functional of navigating within a data structure and
6
+ a purely functional way of navigating within a data structure and
7
7
  manipulating it. They essentially contain a data structure and a
8
8
  pointer into that data structure (called the focus).
9
9
 
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -0,0 +1,43 @@
1
+ big-integer.js
2
+ exercises/accumulate
3
+ exercises/acronym
4
+ exercises/alphametics
5
+ exercises/anagram
6
+ exercises/binary-search
7
+ exercises/binary-search-tree
8
+ exercises/bowling
9
+ exercises/bracket-push
10
+ exercises/circular-buffer
11
+ exercises/clock
12
+ exercises/custom-set
13
+ exercises/diamond
14
+ exercises/flatten-array
15
+ exercises/food-chain
16
+ exercises/grade-school
17
+ exercises/grains
18
+ exercises/kindergarten-garden
19
+ exercises/leap
20
+ exercises/linked-list
21
+ exercises/list-ops
22
+ exercises/luhn
23
+ exercises/minesweeper
24
+ exercises/nth-prime
25
+ exercises/octal
26
+ exercises/palindrome-products
27
+ exercises/pangram
28
+ exercises/perfect-numbers
29
+ exercises/pythagorean-triplet
30
+ exercises/queen-attack
31
+ exercises/robot-name
32
+ exercises/robot-simulator
33
+ exercises/roman-numerals
34
+ exercises/saddle-points
35
+ exercises/say
36
+ exercises/scrabble-score
37
+ exercises/secret-handshake
38
+ exercises/simple-cipher
39
+ exercises/simple-linked-list
40
+ exercises/sum-of-multiples
41
+ exercises/triangle
42
+ exercises/trinary
43
+ exercises/wordy
@@ -6,9 +6,10 @@ node_js:
6
6
  - "node"
7
7
 
8
8
  install:
9
- - "npm install -g jasmine"
9
+ - "npm install"
10
10
 
11
11
  script:
12
12
  - "make test"
13
13
  - "./bin/fetch-configlet"
14
14
  - "./bin/configlet lint ."
15
+ - "npm run lint"
@@ -8,13 +8,13 @@ of a game of bowling.
8
8
 
9
9
  ## Scoring Bowling
10
10
 
11
- The game consists of 10 frames. A frame is composed of one or two ball throws with 10 pins standing at frame initialization. There are three cases for the tabulation of a frame.
11
+ A game consists of 10 frames. A frame is composed of one or two balls thrown, with 10 pins standing at the start of the frame. There are three cases for the tabulation of a frame:
12
12
 
13
- * An open frame is where a score of less than 10 is recorded for the frame. In this case the score for the frame is the number of pins knocked down.
13
+ * An open frame is where a score of less than 10 is recorded for the frame. In this case the score for the frame is the number of pins knocked down after the second throw.
14
14
 
15
- * A spare is where all ten pins are knocked down after the second throw. The total value of a spare is 10 plus the number of pins knocked down in their next throw.
15
+ * A spare is where all ten pins are knocked down after the second throw. The total value of a spare is 10 plus the number of pins knocked down in the next throw.
16
16
 
17
- * A strike is where all ten pins are knocked down after the first throw. The total value of a strike is 10 plus the number of pins knocked down in their next two throws. If a strike is immediately followed by a second strike, then we can not total the value of first strike until they throw the ball one more time.
17
+ * A strike is where all ten pins are knocked down after the first throw. The total value of a strike is 10 plus the number of pins knocked down in the next two throws. If a strike is immediately followed by another strike, then the first strike's value cannot be totalled until the next throw.
18
18
 
19
19
  Here is a three frame example:
20
20
 
@@ -30,7 +30,7 @@ Frame 3 is (9 + 0) = 9
30
30
 
31
31
  This means the current running total is 48.
32
32
 
33
- The tenth frame in the game is a special case. If someone throws a strike or a spare then they get a fill ball. Fill balls exist to calculate the total of the 10th frame. Scoring a strike or spare on the fill ball does not give the player more fill balls. The total value of the 10th frame is the total number of pins knocked down.
33
+ The tenth frame in the game is a special case. If the player throws a strike or a spare, then they get one extra throw called a fill ball. Fill balls exist to calculate the total of the 10th frame. Scoring a strike or spare on the fill ball does not give the player more fill balls. The total value of the 10th frame is the total number of pins knocked down.
34
34
 
35
35
  For a tenth frame of X1/ (strike and a spare), the total value is 20.
36
36
 
@@ -22,7 +22,8 @@ module.exports = function (input) {
22
22
 
23
23
  this.ciphertext = function () {
24
24
  var textSegments = this.plaintextSegments();
25
- var i, j;
25
+ var i;
26
+ var j;
26
27
  var columns = [];
27
28
  var currentSegment;
28
29
  var currentLetter;
@@ -1,6 +1,6 @@
1
1
  var DiffieHellman = require('./diffie-hellman');
2
2
 
3
- describe('diffie-hellman', function(){
3
+ describe('diffie-hellman', function () {
4
4
  var p = 23;
5
5
  var g = 5;
6
6
  var diffieHellman = new DiffieHellman(p, g);
@@ -11,57 +11,57 @@ describe('diffie-hellman', function(){
11
11
  var bobPrivateKey = 15;
12
12
  var bobPublicKey = 19;
13
13
 
14
- it('throws an error if the constructor arguments are out of range', function() {
15
- expect(function() {
16
- new DiffieHellman(0, 9999);
14
+ it('throws an error if the constructor arguments are out of range', function () {
15
+ expect(function () {
16
+ return new DiffieHellman(0, 9999);
17
17
  }).toThrow();
18
18
  });
19
19
 
20
- xit('throws an error if the constructor arguments are not prime', function() {
21
- expect(function() {
22
- new DiffieHellman(10, 13);
20
+ xit('throws an error if the constructor arguments are not prime', function () {
21
+ expect(function () {
22
+ return new DiffieHellman(10, 13);
23
23
  }).toThrow();
24
24
  });
25
25
 
26
- xit('throws an error if private key is negative', function() {
27
- expect(function() {
26
+ xit('throws an error if private key is negative', function () {
27
+ expect(function () {
28
28
  diffieHellman.getPublicKeyFromPrivateKey(-1);
29
29
  }).toThrow();
30
30
  });
31
31
 
32
- xit('throws an error if private key is zero', function() {
33
- expect(function() {
32
+ xit('throws an error if private key is zero', function () {
33
+ expect(function () {
34
34
  diffieHellman.getPublicKeyFromPrivateKey(0);
35
35
  }).toThrow();
36
36
  });
37
37
 
38
- xit('throws an error if private key is one', function() {
39
- expect(function() {
38
+ xit('throws an error if private key is one', function () {
39
+ expect(function () {
40
40
  diffieHellman.getPublicKeyFromPrivateKey(1);
41
41
  }).toThrow();
42
42
  });
43
43
 
44
- xit('throws an error if private key equals the modulus parameter p', function() {
45
- expect(function() {
44
+ xit('throws an error if private key equals the modulus parameter p', function () {
45
+ expect(function () {
46
46
  diffieHellman.getPublicKeyFromPrivateKey(p);
47
47
  }).toThrow();
48
48
  });
49
49
 
50
- xit('throws an error if private key is greater than the modulus parameter p', function() {
51
- expect(function() {
50
+ xit('throws an error if private key is greater than the modulus parameter p', function () {
51
+ expect(function () {
52
52
  diffieHellman.getPublicKeyFromPrivateKey(p + 1);
53
53
  }).toThrow();
54
54
  });
55
55
 
56
- xit('when given a private key, returns the correct public one', function() {
56
+ xit('when given a private key, returns the correct public one', function () {
57
57
  expect(diffieHellman.getPublicKeyFromPrivateKey(alicePrivateKey)).toEqual(alicePublicKey);
58
58
  });
59
59
 
60
- xit('when given a different private key, returns the correct public one', function() {
60
+ xit('when given a different private key, returns the correct public one', function () {
61
61
  expect(diffieHellman.getPublicKeyFromPrivateKey(bobPrivateKey)).toEqual(bobPublicKey);
62
62
  });
63
63
 
64
- xit('can generate a shared secret from our private key and their public key', function() {
64
+ xit('can generate a shared secret from our private key and their public key', function () {
65
65
  var sharedSecret = 2;
66
66
 
67
67
  expect(diffieHellman.getSharedSecret(alicePrivateKey, bobPublicKey))