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,6 +1,6 @@
1
1
  import ceylon.test { ... }
2
2
 
3
- // Tests adapted from problem-specifications version 2.0.0
3
+ // Tests adapted from problem-specifications version 2.0.1
4
4
  {[String, String, Integer?]*} cases => {
5
5
  // identical strands
6
6
  ["A", "A", 0],
@@ -17,9 +17,9 @@ import ceylon.test { ... }
17
17
  // small distance in long strands
18
18
  ["ACCAGGG", "ACTATGG", 2],
19
19
  // non-unique character in first strand
20
- ["AGA", "AGG", 1],
20
+ ["AAG", "AAA", 1],
21
21
  // non-unique character in second strand
22
- ["AGG", "AGA", 1],
22
+ ["AAA", "AAG", 1],
23
23
  // same nucleotides in different positions
24
24
  ["TAG", "GAT", 2],
25
25
  // large distance
@@ -1,8 +1,8 @@
1
1
  import ceylon.test { ... }
2
2
 
3
- // Tests adapted from problem-specifications version 1.0.0
3
+ // Tests adapted from problem-specifications version 1.2.0
4
4
  {[Integer, Boolean]*} cases =>
5
- {[2015, false], [2016, true], [2100, false], [2000, true]};
5
+ {[2015, false], [1996, true], [2100, false], [2000, true]};
6
6
 
7
7
  test
8
8
  parameters(`value cases`)
@@ -13,7 +13,7 @@ The format is usually represented as
13
13
 
14
14
  where `N` is any digit from 2 through 9 and `X` is any digit from 0 through 9.
15
15
 
16
- Your task is to clean up differently formated telephone numbers by removing punctuation and the country code (1) if present.
16
+ Your task is to clean up differently formatted telephone numbers by removing punctuation and the country code (1) if present.
17
17
 
18
18
  For example, the inputs
19
19
  - `+1 (613)-995-0253`
@@ -11,7 +11,7 @@ void main() {
11
11
  group("PhoneNumber: Edge cases - ", edgeCases);
12
12
  }
13
13
 
14
- cleanUpTest() {
14
+ void cleanUpTest() {
15
15
  test("cleans the number", () {
16
16
  expect(phoneNumber.cleanNumber("(223) 456-7890"), equals("2234567890"));
17
17
  }, skip: false);
@@ -23,7 +23,7 @@ cleanUpTest() {
23
23
  }, skip: true);
24
24
  }
25
25
 
26
- numberLengthTest() {
26
+ void numberLengthTest() {
27
27
  test("invalid when 9 digits", () {
28
28
  expect(phoneNumber.cleanNumber("123456789"), equals(null));
29
29
  }, skip: true);
@@ -41,7 +41,7 @@ numberLengthTest() {
41
41
  }, skip: true);
42
42
  }
43
43
 
44
- numbersOnlyTest() {
44
+ void numbersOnlyTest() {
45
45
  test("invalid with letters", () {
46
46
  expect(phoneNumber.cleanNumber("123-abc-7890"), equals(null));
47
47
  }, skip: true);
@@ -50,7 +50,7 @@ numbersOnlyTest() {
50
50
  }, skip: true);
51
51
  }
52
52
 
53
- codeRangeTest() {
53
+ void codeRangeTest() {
54
54
  test("invalid if area code does not start with 2-9", () {
55
55
  expect(phoneNumber.cleanNumber("(123) 456-7890"), equals(null));
56
56
  }, skip: true);
@@ -59,7 +59,7 @@ codeRangeTest() {
59
59
  }, skip: true);
60
60
  }
61
61
 
62
- edgeCases() {
62
+ void edgeCases() {
63
63
  test("invalid if passes all other tests but contains special characters", () {
64
64
  expect(phoneNumber.cleanNumber("123-@:!-78901256"), equals(null));
65
65
  }, skip: true);
@@ -0,0 +1,5 @@
1
+ *.swp
2
+ .DS_Store
3
+ tmp
4
+ .apl.history
5
+ *.log
@@ -1,11 +1,16 @@
1
+ services:
2
+ - docker
3
+
1
4
  language: bash
2
5
 
6
+ env:
7
+ - APL_VERSION=1.6
8
+ - APL_VERSION=svn945 # fixes a bug in 1.7 release; see https://lists.gnu.org/archive/html/bug-apl/2017-05/msg00016.html
9
+
3
10
  before_install:
4
- - wget ftp://ftp.gnu.org/gnu/apl/apl_1.6-1_amd64.deb
5
- - sudo dpkg -i apl_1.6-1_amd64.deb
6
- - cp -rv .travis/.gnu-apl ~
11
+ - bin/install-apl
7
12
  - bin/fetch-configlet
8
13
 
9
14
  script:
10
15
  - bin/configlet lint .
11
- - bin/run-all-tests
16
+ - docker run apl 'bin/run-all-tests'
@@ -0,0 +1,15 @@
1
+ FROM ubuntu:xenial
2
+ LABEL maintainer="marnen@marnen.org"
3
+
4
+ ARG apl_deb
5
+ WORKDIR /gnu-apl
6
+ ADD . /gnu-apl
7
+
8
+ RUN apt-get update -y
9
+ RUN dpkg -i ${apl_deb}
10
+ RUN rm ${apl_deb}
11
+
12
+ # 1.6 and before
13
+ COPY .travis/.gnu-apl /etc/gnu-apl/
14
+ # 1.7 and later
15
+ COPY .travis/.gnu-apl /etc/gnu-apl.d/
@@ -0,0 +1,22 @@
1
+ FROM ubuntu:xenial
2
+ LABEL maintainer="marnen@marnen.org"
3
+
4
+ RUN apt-get update && apt-get install -y g++ build-essential
5
+
6
+ ARG apl_dir
7
+ ARG base_dir=/gnu-apl
8
+ WORKDIR ${base_dir}
9
+ ADD . ${base_dir}
10
+
11
+ WORKDIR ${apl_dir}
12
+ RUN ./configure --prefix=/usr --sysconfdir=/etc
13
+ RUN make
14
+ RUN make install
15
+
16
+ WORKDIR ${base_dir}
17
+ RUN rm -r ${apl_dir}
18
+
19
+ # 1.6 and before
20
+ COPY .travis/.gnu-apl /etc/gnu-apl/
21
+ # 1.7 and later
22
+ COPY .travis/.gnu-apl /etc/gnu-apl.d/
@@ -10,7 +10,7 @@ Exercism exercises in GNU APL.
10
10
 
11
11
  On MacOS, GNU APL is available as a [Homebrew](http://brew.sh) formula; just type `brew install gnu-apl` to install it.
12
12
 
13
- On other operating systems, the simplest way to install GNU APL is probably to follow the instructions on the [GNU APL website](https://www.gnu.org/software/apl/). Note that version 1.7 seems to have build issues on some systems; if you can't build 1.7, then 1.6 should work.
13
+ On other operating systems, the simplest way to install GNU APL is probably to follow the instructions on the [GNU APL website](https://www.gnu.org/software/apl/). Version 1.6 works, but version 1.7 [has some bugs involving the `)COPY` system command](https://lists.gnu.org/archive/html/bug-apl/2017-05/msg00016.html) that prevent it from working for Exercism. If you want 1.7 features for Exercism, then build it from source at SVN commit 945 (when the bug was fixed) or later.
14
14
 
15
15
  ### Installing a keyboard layout
16
16
 
@@ -0,0 +1,26 @@
1
+ #!/bin/bash
2
+
3
+ DOCKERFILE_PATH=Dockerfiles
4
+
5
+ prepare_svn_install() {
6
+ SVN_REV=${APL_VERSION#svn}
7
+ APL_DIR=apl-src
8
+ svn co "svn://svn.savannah.gnu.org/apl/trunk@${SVN_REV}" $APL_DIR
9
+ BUILD_ARGS="--build-arg apl_dir=${APL_DIR}"
10
+ DOCKERFILE=svn.dockerfile
11
+ }
12
+
13
+ prepare_release_install() {
14
+ APL_DEB=apl_${APL_VERSION}-1_amd64.deb
15
+ wget ftp://ftp.gnu.org/gnu/apl/${APL_DEB}
16
+ BUILD_ARGS="--build-arg apl_deb=${APL_DEB}"
17
+ DOCKERFILE=release.dockerfile
18
+ }
19
+
20
+ if [[ ${APL_VERSION} =~ ^svn ]]; then
21
+ prepare_svn_install
22
+ else
23
+ prepare_release_install
24
+ fi
25
+
26
+ docker build -f ${DOCKERFILE_PATH}/${DOCKERFILE} -t apl ${BUILD_ARGS} .
@@ -1,9 +1,10 @@
1
1
  #!/usr/bin/env apl --script
2
+ )COPY 5 FILE_IO.apl
2
3
 
3
4
  ⍝ Clear logfile with given filename.
4
5
  ∇test∆clear_log filename;handle;_
5
- handle←'w' FIO[3] filename
6
- _←⎕FIO[4] handle
6
+ handle←'w' FIO∆fopen filename
7
+ _FIO∆fclose handle
7
8
 
8
9
 
9
10
  ⍝ )COPY file relative to current directory.
@@ -13,7 +14,7 @@
13
14
 
14
15
  ⍝ Write logfile with given filename to stderr as UTF-8.
15
16
  ∇test∆show_log filename;cr
16
- cr←⎕ucs 10
17
+ cr←⎕UCS 10
17
18
  test¯warn cr,'***** TEST LOG *****',cr,cr
18
19
  test¯warn test¯read_unicode filename
19
20
 
@@ -35,15 +36,15 @@
35
36
 
36
37
  ⍝ Return current directory as a string.
37
38
  ∇pwd←test¯pwd
38
- pwd←⎕FIO 30
39
+ pwdFIO∆getcwd
39
40
 
40
41
 
41
42
  ⍝ Read a UTF-8 file into a Unicode character vector.
42
43
  ∇unicode←test¯read_unicode filename
43
- unicode←19⎕CR FIO[26] filename
44
+ unicode←19⎕CR FIO∆read_file filename
44
45
 
45
46
 
46
47
  ⍝ Write string to stderr.
47
48
  ∇test¯warn string;_
48
- _←'%s' string ⎕FIO[22] 2
49
+ _←FIO∆fprintf_stderr '%s' string
49
50
 
@@ -26,7 +26,7 @@ Please run [`go fmt`](http://blog.golang.org/go-fmt-your-code) on your code befo
26
26
 
27
27
  The README.md for each exercise gives a general description but the Go test program will be very specific. Open the test program and give it a quick look - if it seems like cheating, do it anyway. Look for helpful comments, test data, and just the names of the test functions. Try running `go test` before you have written anything and see if the error messages give you an idea of where to start.
28
28
 
29
- Your first goal it to get something to compile, even though it fails tests. For this, you should "stub" functions. That means leave the body empty, except for whatever it must return. Write `return 0` or `return ""` or whatever just to get it to compile. Sometimes to figure out function signatures you will have to go back to the test program and read in more detail. Once you have figured out all the required function signatures, the test program will complain that 0 is the wrong answer. Now start filling in function bodies.
29
+ Your first goal is to get something to compile, even though it fails tests. For this, you should "stub" functions. That means leave the body empty, except for whatever it must return. Write `return 0` or `return ""` or whatever just to get it to compile. Sometimes to figure out function signatures you will have to go back to the test program and read in more detail. Once you have figured out all the required function signatures, the test program will complain that 0 is the wrong answer. Now start filling in function bodies.
30
30
 
31
31
  ### Fixing
32
32
 
@@ -12,7 +12,7 @@ cache:
12
12
  - $HOME/.foldercache # Per exercise `.stack-work` cache.
13
13
 
14
14
  env:
15
- - RESOLVER="lts-8.21" CURRENT="YES" # Equal to each stack.yaml.
15
+ - RESOLVER="lts-9.11" CURRENT="YES" # Equal to each stack.yaml.
16
16
  - RESOLVER="nightly" # Latest nightly snapshot.
17
17
 
18
18
  matrix:
@@ -22,6 +22,15 @@
22
22
  "topics": [
23
23
  ]
24
24
  },
25
+ {
26
+ "uuid": "e5a0bed3-90ca-4caa-a73f-2124940f84c9",
27
+ "slug": "isbn-verifier",
28
+ "core": false,
29
+ "unlocked_by": null,
30
+ "difficulty": 1,
31
+ "topics": [
32
+ ]
33
+ },
25
34
  {
26
35
  "uuid": "6cbb7841-9d96-4528-88e3-6e98a450fd7c",
27
36
  "slug": "space-age",
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1,5 +1,5 @@
1
1
  name: acronym
2
- version: 1.0.0.2
2
+ version: 1.1.0.3
3
3
 
4
4
  dependencies:
5
5
  - base
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -28,6 +28,9 @@ cases = [ Case { description = "basic"
28
28
  , input = "Ruby on Rails"
29
29
  , expected = "ROR"
30
30
  }
31
+ -- Although this case was removed in specification 1.1.0,
32
+ -- the Haskell track has chosen to keep it,
33
+ -- since it makes the problem more interesting.
31
34
  , Case { description = "camelcase"
32
35
  , input = "HyperText Markup Language"
33
36
  , expected = "HTML"
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -2,6 +2,7 @@
2
2
  module Alphametics (solve) where
3
3
 
4
4
  import Control.Monad (guard)
5
+ import Data.Functor (($>))
5
6
  import Data.List (foldl', find, union)
6
7
  import Data.Maybe (fromJust, isJust, listToMaybe)
7
8
  import Prelude hiding (Word)
@@ -109,7 +110,7 @@ word :: Parser (Term Integer)
109
110
  word = Word <$> many1 upper
110
111
 
111
112
  plus :: Parser (Term Integer -> Term Integer -> Term Integer)
112
- plus = trimmed (char '+') *> pure Plus
113
+ plus = trimmed (char '+') $> Plus
113
114
 
114
115
  trimmed :: Parser a -> Parser a
115
116
  trimmed p = spaces *> p <* spaces
@@ -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,5 @@
1
1
  name: crypto-square
2
- version: 3.0.0.3
2
+ version: 3.1.0.4
3
3
 
4
4
  dependencies:
5
5
  - base
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -31,7 +31,11 @@ data Case = Case { description :: String
31
31
  }
32
32
 
33
33
  cases :: [Case]
34
- cases = [ Case { description = "Lowercase"
34
+ cases = [ Case { description = "empty plaintext results in an empty ciphertext"
35
+ , input = ""
36
+ , expected = ""
37
+ }
38
+ , Case { description = "Lowercase"
35
39
  , input = "A"
36
40
  , expected = "a"
37
41
  }
@@ -43,14 +47,14 @@ cases = [ Case { description = "Lowercase"
43
47
  , input = "@1,%!"
44
48
  , expected = "1"
45
49
  }
46
- , Case { description = "empty plaintext results in an empty ciphertext"
47
- , input = ""
48
- , expected = ""
49
- }
50
50
  , Case { description = "9 character plaintext results in 3 chunks of 3 characters"
51
51
  , input = "This is fun!"
52
52
  , expected = "tsf hiu isn"
53
53
  }
54
+ , Case { description = "8 character plaintext results in 3 chunks, the last one with a trailing space"
55
+ , input = "Chill out."
56
+ , expected = "clu hlt io "
57
+ }
54
58
  , Case { description = "54 character plaintext results in 7 chunks, the last two padded with spaces"
55
59
  , input = "If man was meant to stay on the ground, god would have given us roots."
56
60
  , expected = "imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau "
@@ -1,5 +1,5 @@
1
1
  name: custom-set
2
- version: 1.0.1.3
2
+ version: 1.1.0.4
3
3
 
4
4
  dependencies:
5
5
  - base
@@ -1 +1 @@
1
- resolver: lts-8.21
1
+ resolver: lts-9.11
@@ -102,6 +102,9 @@ specs = do
102
102
  it "sets with different elements are not equal" $
103
103
  (fromList [1, 2, 3] == fromList [1, 2, 4]) `shouldBe` False
104
104
 
105
+ it "set is not equal to larger set with same elements" $
106
+ (fromList [1, 2, 3] == fromList [1, 2, 3, 4]) `shouldBe` False
107
+
105
108
  describe "insert" $ do
106
109
 
107
110
  it "add to empty set" $