trackler 2.2.1.71 → 2.2.1.72

Sign up to get free protection for your applications and to get access to all the features.
Files changed (270) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/exercises/book-store/canonical-data.json +9 -2
  4. data/problem-specifications/exercises/word-count/canonical-data.json +9 -0
  5. data/tracks/bash/CONTRIBUTING.md +199 -0
  6. data/tracks/bash/config.json +24 -11
  7. data/tracks/bash/exercises/triangle/README.md +38 -0
  8. data/tracks/bash/exercises/triangle/example.sh +56 -0
  9. data/tracks/bash/exercises/triangle/triangle_test.sh +126 -0
  10. data/tracks/bash/img/canonical-data-example.png +0 -0
  11. data/tracks/bash/img/create-pr.png +0 -0
  12. data/tracks/bash/img/fork-repository.png +0 -0
  13. data/tracks/c/exercises/acronym/makefile +1 -1
  14. data/tracks/c/exercises/all-your-base/makefile +1 -1
  15. data/tracks/c/exercises/allergies/makefile +1 -1
  16. data/tracks/c/exercises/anagram/makefile +1 -1
  17. data/tracks/c/exercises/atbash-cipher/makefile +1 -1
  18. data/tracks/c/exercises/beer-song/makefile +1 -1
  19. data/tracks/c/exercises/binary-search/makefile +1 -1
  20. data/tracks/c/exercises/binary/makefile +1 -1
  21. data/tracks/c/exercises/bob/makefile +1 -1
  22. data/tracks/c/exercises/clock/makefile +1 -1
  23. data/tracks/c/exercises/collatz-conjecture/makefile +1 -1
  24. data/tracks/c/exercises/difference-of-squares/makefile +1 -1
  25. data/tracks/c/exercises/gigasecond/makefile +1 -1
  26. data/tracks/c/exercises/grains/makefile +1 -1
  27. data/tracks/c/exercises/hamming/makefile +1 -1
  28. data/tracks/c/exercises/hamming/test/test_hamming.c +2 -2
  29. data/tracks/c/exercises/hello-world/makefile +1 -1
  30. data/tracks/c/exercises/isogram/makefile +1 -1
  31. data/tracks/c/exercises/largest-series-product/makefile +1 -1
  32. data/tracks/c/exercises/leap/makefile +1 -1
  33. data/tracks/c/exercises/meetup/makefile +1 -1
  34. data/tracks/c/exercises/nth-prime/makefile +1 -1
  35. data/tracks/c/exercises/nucleotide-count/makefile +1 -1
  36. data/tracks/c/exercises/palindrome-products/makefile +1 -1
  37. data/tracks/c/exercises/pangram/makefile +1 -1
  38. data/tracks/c/exercises/pascals-triangle/makefile +1 -1
  39. data/tracks/c/exercises/perfect-numbers/makefile +1 -1
  40. data/tracks/c/exercises/phone-number/makefile +1 -1
  41. data/tracks/c/exercises/queen-attack/makefile +1 -1
  42. data/tracks/c/exercises/raindrops/makefile +1 -1
  43. data/tracks/c/exercises/react/makefile +1 -1
  44. data/tracks/c/exercises/rna-transcription/makefile +1 -1
  45. data/tracks/c/exercises/robot-simulator/makefile +1 -1
  46. data/tracks/c/exercises/roman-numerals/makefile +1 -1
  47. data/tracks/c/exercises/scrabble-score/makefile +1 -1
  48. data/tracks/c/exercises/series/makefile +1 -1
  49. data/tracks/c/exercises/sieve/makefile +1 -1
  50. data/tracks/c/exercises/space-age/makefile +1 -1
  51. data/tracks/c/exercises/sublist/makefile +1 -1
  52. data/tracks/c/exercises/sum-of-multiples/makefile +1 -1
  53. data/tracks/c/exercises/triangle/makefile +1 -1
  54. data/tracks/c/exercises/word-count/makefile +1 -1
  55. data/tracks/delphi/exercises/allergies/README.md +1 -1
  56. data/tracks/delphi/exercises/bank-account/README.md +1 -1
  57. data/tracks/delphi/exercises/beer-song/README.md +1 -1
  58. data/tracks/delphi/exercises/binary-search/README.md +1 -1
  59. data/tracks/delphi/exercises/bob/README.md +1 -1
  60. data/tracks/delphi/exercises/book-store/README.md +1 -1
  61. data/tracks/delphi/exercises/book-store/uBookStoreExample.pas +34 -14
  62. data/tracks/delphi/exercises/book-store/uBookStoreTests.pas +36 -1
  63. data/tracks/delphi/exercises/bowling/README.md +1 -1
  64. data/tracks/delphi/exercises/circular-buffer/README.md +1 -1
  65. data/tracks/delphi/exercises/clock/README.md +1 -1
  66. data/tracks/delphi/exercises/collatz-conjecture/README.md +1 -1
  67. data/tracks/delphi/exercises/etl/README.md +1 -1
  68. data/tracks/delphi/exercises/grains/README.md +1 -1
  69. data/tracks/delphi/exercises/hamming/README.md +1 -1
  70. data/tracks/delphi/exercises/hello-world/README.md +1 -1
  71. data/tracks/delphi/exercises/leap/README.md +1 -1
  72. data/tracks/delphi/exercises/minesweeper/README.md +1 -1
  73. data/tracks/delphi/exercises/nucleotide-count/README.md +1 -1
  74. data/tracks/delphi/exercises/perfect-numbers/README.md +1 -1
  75. data/tracks/delphi/exercises/phone-number/README.md +1 -1
  76. data/tracks/delphi/exercises/pig-latin/README.md +1 -1
  77. data/tracks/delphi/exercises/poker/README.md +1 -1
  78. data/tracks/delphi/exercises/raindrops/README.md +1 -1
  79. data/tracks/delphi/exercises/reverse-string/README.md +1 -1
  80. data/tracks/delphi/exercises/rna-transcription/README.md +1 -1
  81. data/tracks/delphi/exercises/roman-numerals/README.md +1 -1
  82. data/tracks/delphi/exercises/saddle-points/README.md +1 -1
  83. data/tracks/delphi/exercises/triangle/README.md +1 -1
  84. data/tracks/delphi/exercises/two-fer/README.md +1 -1
  85. data/tracks/delphi/exercises/wordy/README.md +1 -1
  86. data/tracks/ecmascript/.travis.yml +1 -1
  87. data/tracks/ecmascript/Makefile +4 -5
  88. data/tracks/ecmascript/README.md +2 -1
  89. data/tracks/ecmascript/config.json +12 -0
  90. data/tracks/ecmascript/exercises/change/package.json +5 -3
  91. data/tracks/ecmascript/exercises/protein-translation/package.json +2 -2
  92. data/tracks/ecmascript/exercises/react/README.md +41 -0
  93. data/tracks/ecmascript/exercises/react/example.js +101 -0
  94. data/tracks/ecmascript/exercises/react/package.json +71 -0
  95. data/tracks/ecmascript/exercises/react/react.spec.js +211 -0
  96. data/tracks/ecmascript/exercises/rectangles/package.json +1 -2
  97. data/tracks/ecmascript/exercises/rotational-cipher/package.json +1 -2
  98. data/tracks/ecmascript/exercises/spiral-matrix/package.json +1 -2
  99. data/tracks/ecmascript/exercises/transpose/package.json +2 -2
  100. data/tracks/erlang/docs/ABOUT.md +1 -1
  101. data/tracks/go/exercises/binary-search/.meta/gen.go +55 -0
  102. data/tracks/go/exercises/binary-search/binary_search_test.go +26 -167
  103. data/tracks/go/exercises/binary-search/cases_test.go +73 -0
  104. data/tracks/go/exercises/binary-search/example.go +8 -30
  105. data/tracks/go/exercises/nth-prime/.meta/gen.go +76 -0
  106. data/tracks/go/exercises/nth-prime/cases_test.go +43 -0
  107. data/tracks/go/exercises/nth-prime/nth_prime_test.go +4 -18
  108. data/tracks/go/exercises/prime-factors/.meta/gen.go +54 -0
  109. data/tracks/go/exercises/prime-factors/cases_test.go +48 -0
  110. data/tracks/go/exercises/prime-factors/prime_factors_test.go +4 -19
  111. data/tracks/groovy/config.json +13 -1
  112. data/tracks/groovy/exercises/linked-list/DoubleLinkedList.groovy +19 -0
  113. data/tracks/groovy/exercises/linked-list/DoubleLinkedListSpec.groovy +79 -0
  114. data/tracks/groovy/exercises/linked-list/Example.groovy +57 -0
  115. data/tracks/groovy/exercises/linked-list/README.md +49 -0
  116. data/tracks/java/bin/run-journey-test-from-ci.sh +1 -1
  117. data/tracks/java/config.json +10 -0
  118. data/tracks/java/config/maintainers.json +8 -1
  119. data/tracks/java/docs/MAINTAINING.md +3 -3
  120. data/tracks/java/exercises/accumulate/.meta/src/reference/java/Accumulate.java +2 -2
  121. data/tracks/java/exercises/binary/.meta/src/reference/java/Binary.java +3 -3
  122. data/tracks/java/exercises/circular-buffer/.meta/src/reference/java/BufferIOException.java +1 -1
  123. data/tracks/java/exercises/circular-buffer/.meta/src/reference/java/CircularBuffer.java +6 -6
  124. data/tracks/java/exercises/circular-buffer/src/main/java/BufferIOException.java +1 -1
  125. data/tracks/java/exercises/clock/.meta/src/reference/java/Clock.java +3 -3
  126. data/tracks/java/exercises/crypto-square/.meta/src/reference/java/Crypto.java +7 -7
  127. data/tracks/java/exercises/etl/.meta/src/reference/java/Etl.java +2 -2
  128. data/tracks/java/exercises/etl/src/main/java/Etl.java +2 -2
  129. data/tracks/java/exercises/kindergarten-garden/.meta/src/reference/java/KindergartenGarden.java +4 -4
  130. data/tracks/java/exercises/kindergarten-garden/.meta/src/reference/java/Plant.java +2 -2
  131. data/tracks/java/exercises/kindergarten-garden/src/main/java/Plant.java +2 -2
  132. data/tracks/java/exercises/nth-prime/.meta/src/reference/java/PrimeCalculator.java +2 -2
  133. data/tracks/java/exercises/reverse-string/.meta/src/reference/java/ReverseString.java +7 -0
  134. data/tracks/java/exercises/reverse-string/.meta/version +1 -0
  135. data/tracks/java/exercises/reverse-string/README.md +25 -0
  136. data/tracks/java/exercises/reverse-string/build.gradle +17 -0
  137. data/tracks/java/exercises/reverse-string/src/main/java/ReverseString.java +7 -0
  138. data/tracks/java/exercises/reverse-string/src/test/java/ReverseStringTest.java +37 -0
  139. data/tracks/java/exercises/run-length-encoding/.meta/src/reference/java/RunLengthEncoding.java +4 -4
  140. data/tracks/java/exercises/settings.gradle +1 -0
  141. data/tracks/kotlin/docs/RESOURCES.md +1 -1
  142. data/tracks/kotlin/exercises/accumulate/build.gradle +1 -1
  143. data/tracks/kotlin/exercises/acronym/build.gradle +1 -1
  144. data/tracks/kotlin/exercises/all-your-base/build.gradle +1 -1
  145. data/tracks/kotlin/exercises/allergies/build.gradle +1 -1
  146. data/tracks/kotlin/exercises/anagram/build.gradle +1 -1
  147. data/tracks/kotlin/exercises/atbash-cipher/build.gradle +1 -1
  148. data/tracks/kotlin/exercises/bank-account/build.gradle +1 -1
  149. data/tracks/kotlin/exercises/beer-song/build.gradle +1 -1
  150. data/tracks/kotlin/exercises/binary-search/build.gradle +1 -1
  151. data/tracks/kotlin/exercises/binary/build.gradle +1 -1
  152. data/tracks/kotlin/exercises/bob/build.gradle +1 -1
  153. data/tracks/kotlin/exercises/bracket-push/build.gradle +1 -1
  154. data/tracks/kotlin/exercises/change/build.gradle +1 -1
  155. data/tracks/kotlin/exercises/clock/build.gradle +1 -1
  156. data/tracks/kotlin/exercises/collatz-conjecture/build.gradle +1 -1
  157. data/tracks/kotlin/exercises/complex-numbers/build.gradle +1 -1
  158. data/tracks/kotlin/exercises/diamond/build.gradle +1 -1
  159. data/tracks/kotlin/exercises/difference-of-squares/build.gradle +1 -1
  160. data/tracks/kotlin/exercises/etl/build.gradle +1 -1
  161. data/tracks/kotlin/exercises/flatten-array/build.gradle +1 -1
  162. data/tracks/kotlin/exercises/forth/build.gradle +1 -1
  163. data/tracks/kotlin/exercises/gigasecond/build.gradle +1 -1
  164. data/tracks/kotlin/exercises/grade-school/build.gradle +1 -1
  165. data/tracks/kotlin/exercises/grains/build.gradle +1 -1
  166. data/tracks/kotlin/exercises/hamming/build.gradle +1 -1
  167. data/tracks/kotlin/exercises/hello-world/build.gradle +1 -1
  168. data/tracks/kotlin/exercises/hexadecimal/build.gradle +1 -1
  169. data/tracks/kotlin/exercises/isogram/build.gradle +1 -1
  170. data/tracks/kotlin/exercises/largest-series-product/build.gradle +1 -1
  171. data/tracks/kotlin/exercises/leap/build.gradle +1 -1
  172. data/tracks/kotlin/exercises/linked-list/build.gradle +1 -1
  173. data/tracks/kotlin/exercises/list-ops/build.gradle +1 -1
  174. data/tracks/kotlin/exercises/luhn/build.gradle +1 -1
  175. data/tracks/kotlin/exercises/meetup/build.gradle +1 -1
  176. data/tracks/kotlin/exercises/minesweeper/build.gradle +1 -1
  177. data/tracks/kotlin/exercises/nth-prime/build.gradle +1 -1
  178. data/tracks/kotlin/exercises/nucleotide-count/build.gradle +1 -1
  179. data/tracks/kotlin/exercises/pangram/build.gradle +1 -1
  180. data/tracks/kotlin/exercises/pascals-triangle/build.gradle +1 -1
  181. data/tracks/kotlin/exercises/perfect-numbers/build.gradle +1 -1
  182. data/tracks/kotlin/exercises/phone-number/build.gradle +1 -1
  183. data/tracks/kotlin/exercises/pig-latin/build.gradle +1 -1
  184. data/tracks/kotlin/exercises/prime-factors/build.gradle +1 -1
  185. data/tracks/kotlin/exercises/raindrops/build.gradle +1 -1
  186. data/tracks/kotlin/exercises/react/build.gradle +1 -1
  187. data/tracks/kotlin/exercises/rna-transcription/build.gradle +1 -1
  188. data/tracks/kotlin/exercises/robot-name/build.gradle +1 -1
  189. data/tracks/kotlin/exercises/robot-simulator/build.gradle +1 -1
  190. data/tracks/kotlin/exercises/roman-numerals/build.gradle +1 -1
  191. data/tracks/kotlin/exercises/rotational-cipher/build.gradle +1 -1
  192. data/tracks/kotlin/exercises/saddle-points/build.gradle +1 -1
  193. data/tracks/kotlin/exercises/say/build.gradle +1 -1
  194. data/tracks/kotlin/exercises/scrabble-score/build.gradle +1 -1
  195. data/tracks/kotlin/exercises/secret-handshake/build.gradle +1 -1
  196. data/tracks/kotlin/exercises/series/build.gradle +1 -1
  197. data/tracks/kotlin/exercises/sieve/build.gradle +1 -1
  198. data/tracks/kotlin/exercises/simple-cipher/README.md +4 -6
  199. data/tracks/kotlin/exercises/simple-cipher/build.gradle +1 -1
  200. data/tracks/kotlin/exercises/space-age/build.gradle +1 -1
  201. data/tracks/kotlin/exercises/spiral-matrix/build.gradle +1 -1
  202. data/tracks/kotlin/exercises/strain/build.gradle +1 -1
  203. data/tracks/kotlin/exercises/sublist/build.gradle +1 -1
  204. data/tracks/kotlin/exercises/sum-of-multiples/build.gradle +1 -1
  205. data/tracks/kotlin/exercises/triangle/build.gradle +1 -1
  206. data/tracks/kotlin/exercises/two-fer/build.gradle +1 -1
  207. data/tracks/kotlin/exercises/word-count/build.gradle +1 -1
  208. data/tracks/lua/.gitignore +1 -0
  209. data/tracks/lua/config.json +12 -0
  210. data/tracks/lua/exercises/isbn-verifier/README.md +52 -0
  211. data/tracks/lua/exercises/isbn-verifier/example.lua +16 -0
  212. data/tracks/lua/exercises/isbn-verifier/isbn-verifier_spec.lua +55 -0
  213. data/tracks/ocaml/.travis-ci.sh +1 -1
  214. data/tracks/ocaml/.travis.yml +1 -1
  215. data/tracks/ocaml/README.md +1 -1
  216. data/tracks/perl6/config.json +10 -0
  217. data/tracks/perl6/exercises/acronym/Acronym.pm6 +4 -0
  218. data/tracks/perl6/exercises/acronym/Example.pm6 +5 -0
  219. data/tracks/perl6/exercises/acronym/README.md +33 -0
  220. data/tracks/perl6/exercises/acronym/acronym.t +96 -0
  221. data/tracks/perl6/exercises/acronym/example.yaml +19 -0
  222. data/tracks/perl6/exercises/word-count/Example.pm6 +1 -1
  223. data/tracks/perl6/exercises/word-count/WordCount.pm6 +1 -1
  224. data/tracks/perl6/exercises/word-count/example.yaml +2 -2
  225. data/tracks/perl6/exercises/word-count/word-count.t +11 -2
  226. data/tracks/pony/docs/RESOURCES.md +1 -1
  227. data/tracks/purescript/docs/INSTALLATION.md +1 -3
  228. data/tracks/python/config.json +1 -1
  229. data/tracks/r/exercises/word-count/test_word-count.R +5 -0
  230. data/tracks/ruby/README.md +73 -10
  231. data/tracks/rust/config.json +34 -0
  232. data/tracks/rust/exercises/book-store/Cargo.toml +1 -1
  233. data/tracks/rust/exercises/book-store/tests/book-store.rs +7 -0
  234. data/tracks/rust/exercises/diffie-hellman/.gitignore +9 -0
  235. data/tracks/rust/exercises/diffie-hellman/Cargo-example.toml +6 -0
  236. data/tracks/rust/exercises/diffie-hellman/Cargo.toml +5 -0
  237. data/tracks/rust/exercises/diffie-hellman/README.md +77 -0
  238. data/tracks/rust/exercises/diffie-hellman/example.rs +15 -0
  239. data/tracks/rust/exercises/diffie-hellman/src/lib.rs +11 -0
  240. data/tracks/rust/exercises/diffie-hellman/tests/diffie-hellman.rs +60 -0
  241. data/tracks/rust/exercises/macros/.gitignore +3 -0
  242. data/tracks/rust/exercises/macros/.meta/description.md +29 -0
  243. data/tracks/rust/exercises/macros/.meta/metadata.yml +3 -0
  244. data/tracks/rust/exercises/macros/Cargo.toml +6 -0
  245. data/tracks/rust/exercises/macros/README.md +70 -0
  246. data/tracks/rust/exercises/macros/example.rs +16 -0
  247. data/tracks/rust/exercises/macros/src/lib.rs +6 -0
  248. data/tracks/rust/exercises/macros/tests/macros.rs +62 -0
  249. data/tracks/rust/exercises/simple-linked-list/.gitignore +7 -0
  250. data/tracks/rust/exercises/simple-linked-list/.meta/hints.md +34 -0
  251. data/tracks/rust/exercises/simple-linked-list/Cargo.toml +5 -0
  252. data/tracks/rust/exercises/simple-linked-list/README.md +96 -0
  253. data/tracks/rust/exercises/simple-linked-list/example.rs +87 -0
  254. data/tracks/rust/exercises/simple-linked-list/src/lib.rs +46 -0
  255. data/tracks/rust/exercises/simple-linked-list/tests/simple-linked-list.rs +91 -0
  256. data/tracks/swift/.travis.yml +1 -1
  257. data/tracks/swift/config.json +24 -0
  258. data/tracks/swift/exercises/isbn-verifier/Package.swift +5 -0
  259. data/tracks/swift/exercises/isbn-verifier/README.md +39 -0
  260. data/tracks/swift/exercises/isbn-verifier/Sources/IsbnVerifier.swift +1 -0
  261. data/tracks/swift/exercises/isbn-verifier/Sources/IsbnVerifierExample.swift +35 -0
  262. data/tracks/swift/exercises/isbn-verifier/Tests/IsbnVerifierTests/IsbnVerifierTests.swift +75 -0
  263. data/tracks/swift/exercises/isbn-verifier/Tests/LinuxMain.swift +6 -0
  264. data/tracks/swift/exercises/two-fer/Package.swift +5 -0
  265. data/tracks/swift/exercises/two-fer/README.md +54 -0
  266. data/tracks/swift/exercises/two-fer/Sources/TwoFer.swift +1 -0
  267. data/tracks/swift/exercises/two-fer/Sources/TwoFerExample.swift +6 -0
  268. data/tracks/swift/exercises/two-fer/Tests/LinuxMain.swift +6 -0
  269. data/tracks/swift/exercises/two-fer/Tests/TwoFerTests/TwoFerTests.swift +25 -0
  270. metadata +71 -2
@@ -1,5 +1,5 @@
1
1
  buildscript {
2
- ext.kotlin_version = '1.1.4-3'
2
+ ext.kotlin_version = '1.2.0'
3
3
  repositories {
4
4
  mavenCentral()
5
5
  }
@@ -1,5 +1,5 @@
1
1
  buildscript {
2
- ext.kotlin_version = '1.1.4-3'
2
+ ext.kotlin_version = '1.2.0'
3
3
  repositories {
4
4
  mavenCentral()
5
5
  }
@@ -1,5 +1,5 @@
1
1
  buildscript {
2
- ext.kotlin_version = '1.1.4-3'
2
+ ext.kotlin_version = '1.2.0'
3
3
  repositories {
4
4
  mavenCentral()
5
5
  }
@@ -1,5 +1,5 @@
1
1
  buildscript {
2
- ext.kotlin_version = '1.1.4-3'
2
+ ext.kotlin_version = '1.2.0'
3
3
  repositories {
4
4
  mavenCentral()
5
5
  }
@@ -1,5 +1,5 @@
1
1
  buildscript {
2
- ext.kotlin_version = '1.1.4-3'
2
+ ext.kotlin_version = '1.2.0'
3
3
  repositories {
4
4
  mavenCentral()
5
5
  }
@@ -58,15 +58,13 @@ would get the same thing as the Caesar Cipher.
58
58
 
59
59
  The weakest link in any cipher is the human being. Let's make your
60
60
  substitution cipher a little more fault tolerant by providing a source
61
- of randomness and ensuring that the key is not composed of numbers or
62
- capital letters.
61
+ of randomness and ensuring that the key contains only lowercase letters.
63
62
 
64
63
  If someone doesn't submit a key at all, generate a truly random key of
65
- at least 100 characters in length, accessible via Cipher#key (the #
66
- syntax means instance variable)
64
+ at least 100 characters in length.
67
65
 
68
- If the key submitted has capital letters or numbers, throw an
69
- ArgumentError with a message to that effect.
66
+ If the key submitted is not composed only of lowercase letters, your
67
+ solution should handle the error in a language-appropriate way.
70
68
 
71
69
  ## Extensions
72
70
 
@@ -1,5 +1,5 @@
1
1
  buildscript {
2
- ext.kotlin_version = '1.1.4-3'
2
+ ext.kotlin_version = '1.2.0'
3
3
  repositories {
4
4
  mavenCentral()
5
5
  }
@@ -1,5 +1,5 @@
1
1
  buildscript {
2
- ext.kotlin_version = '1.1.4-3'
2
+ ext.kotlin_version = '1.2.0'
3
3
  repositories {
4
4
  mavenCentral()
5
5
  }
@@ -1,5 +1,5 @@
1
1
  buildscript {
2
- ext.kotlin_version = '1.1.4-3'
2
+ ext.kotlin_version = '1.2.0'
3
3
  repositories {
4
4
  mavenCentral()
5
5
  }
@@ -1,5 +1,5 @@
1
1
  buildscript {
2
- ext.kotlin_version = '1.1.4-3'
2
+ ext.kotlin_version = '1.2.0'
3
3
  repositories {
4
4
  mavenCentral()
5
5
  }
@@ -1,5 +1,5 @@
1
1
  buildscript {
2
- ext.kotlin_version = '1.1.4-3'
2
+ ext.kotlin_version = '1.2.0'
3
3
  repositories {
4
4
  mavenCentral()
5
5
  }
@@ -1,5 +1,5 @@
1
1
  buildscript {
2
- ext.kotlin_version = '1.1.4-3'
2
+ ext.kotlin_version = '1.2.0'
3
3
  repositories {
4
4
  mavenCentral()
5
5
  }
@@ -1,5 +1,5 @@
1
1
  buildscript {
2
- ext.kotlin_version = '1.1.4-3'
2
+ ext.kotlin_version = '1.2.0'
3
3
  repositories {
4
4
  mavenCentral()
5
5
  }
@@ -1,5 +1,5 @@
1
1
  buildscript {
2
- ext.kotlin_version = '1.1.4-3'
2
+ ext.kotlin_version = '1.2.0'
3
3
  repositories {
4
4
  mavenCentral()
5
5
  }
@@ -1,5 +1,5 @@
1
1
  buildscript {
2
- ext.kotlin_version = '1.1.4-3'
2
+ ext.kotlin_version = '1.2.0'
3
3
  repositories {
4
4
  mavenCentral()
5
5
  }
@@ -6,3 +6,4 @@
6
6
 
7
7
  .DS_Store
8
8
  bin/configlet.exe
9
+ bin/configlet
@@ -942,6 +942,18 @@
942
942
  ],
943
943
  "unlocked_by": "list-ops",
944
944
  "uuid": "09df8b87-c2cf-44a7-879c-96c9030cf27b"
945
+ },
946
+ {
947
+ "core": false,
948
+ "difficulty": 3,
949
+ "slug": "isbn-verifier",
950
+ "topics": [
951
+ "mathematics",
952
+ "control_flow_loops",
953
+ "strings"
954
+ ],
955
+ "unlocked_by": "run-length-encoding",
956
+ "uuid": "a9a6a2c7-2a58-4090-b538-5a275c521fe0"
945
957
  }
946
958
  ],
947
959
  "foregone": [],
@@ -0,0 +1,52 @@
1
+ # Isbn Verifier
2
+
3
+ Check if a given ISBN-10 is valid.
4
+
5
+ ## Functionality
6
+
7
+ Given an unkown 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.
9
+
10
+ The program should allow for ISBN-10 without the separating dashes to be verified as well.
11
+
12
+ ## ISBN
13
+
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.
18
+
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.
21
+
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
25
+
26
+ Which proves that the ISBN is valid.
27
+
28
+ ## Caveats
29
+
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'.
32
+
33
+ ## Bonus tasks
34
+
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
+ ## Running the tests
39
+
40
+ To run the tests, run the command `busted .` from within the exercise directory.
41
+
42
+ ## Further information
43
+
44
+ For more detailed information about the Lua track, including how to get help if
45
+ you're having trouble, please visit the exercism.io [Lua language page](http://exercism.io/languages/lua/about).
46
+
47
+ ## Source
48
+
49
+ Converting a string into a number and some basic processing utilizing a relatable real world example. [https://en.wikipedia.org/wiki/International_Standard_Book_Number#ISBN-10_check_digit_calculation](https://en.wikipedia.org/wiki/International_Standard_Book_Number#ISBN-10_check_digit_calculation)
50
+
51
+ ## Submitting Incomplete Solutions
52
+ It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -0,0 +1,16 @@
1
+ return {
2
+ valid = function(isbn)
3
+ isbn = isbn:gsub('-', '')
4
+
5
+ if not isbn:match('^%d%d%d%d%d%d%d%d%d[%dX]$') then
6
+ return false
7
+ end
8
+
9
+ local sum = 0
10
+ for i = 1, 10 do
11
+ sum = sum + (11 - i) * (tonumber(isbn:sub(i, i)) or 10)
12
+ end
13
+
14
+ return sum % 11 == 0
15
+ end
16
+ }
@@ -0,0 +1,55 @@
1
+ local valid = require('isbn-verifier').valid
2
+
3
+ describe('isbn-verifier', function()
4
+ it('valid isbn number', function()
5
+ assert.is_true(valid('3-598-21508-8'))
6
+ end)
7
+
8
+ it('invalid isbn check digit', function()
9
+ assert.is_false(valid('3-598-21508-9'))
10
+ end)
11
+
12
+ it('valid isbn number with a check digit of 10', function()
13
+ assert.is_true(valid('3-598-21507-X'))
14
+ end)
15
+
16
+ it('check digit is a character other than X', function()
17
+ assert.is_false(valid('3-598-21507-A'))
18
+ end)
19
+
20
+ it('invalid character in isbn', function()
21
+ assert.is_false(valid('3-598-2K507-0'))
22
+ end)
23
+
24
+ it('X is only valid as a check digit', function()
25
+ assert.is_false(valid('3-598-2X507-9'))
26
+ end)
27
+
28
+ it('valid isbn without separating dashes', function()
29
+ assert.is_true(valid('3598215088'))
30
+ end)
31
+
32
+ it('isbn without separating dashes and X as check digit', function()
33
+ assert.is_true(valid('359821507X'))
34
+ end)
35
+
36
+ it('isbn without check digit and dashes', function()
37
+ assert.is_false(valid('359821507'))
38
+ end)
39
+
40
+ it('too long isbn and no dashes', function()
41
+ assert.is_false(valid('3598215078X'))
42
+ end)
43
+
44
+ it('isbn without check digit', function()
45
+ assert.is_false(valid('3-598-21507'))
46
+ end)
47
+
48
+ it('too long isbn', function()
49
+ assert.is_false(valid('3-598-21507-XX'))
50
+ end)
51
+
52
+ it('check digit of X should not be used for 0', function()
53
+ assert.is_false(valid('3-598-21515-X'))
54
+ end)
55
+ end)
@@ -2,7 +2,7 @@
2
2
  OPAM_DEPENDS="ocamlfind core ounit react ppx_deriving"
3
3
 
4
4
  case "$OCAML_VERSION,$OPAM_VERSION" in
5
- 4.05.0,1.2.2) ppa=avsm/ocaml42+opam12 ;;
5
+ 4.06.0,1.2.2) ppa=avsm/ocaml42+opam12 ;;
6
6
  *) echo Unknown $OCAML_VERSION,$OPAM_VERSION; exit 1 ;;
7
7
  esac
8
8
 
@@ -6,4 +6,4 @@ script:
6
6
  - bin/configlet lint .
7
7
 
8
8
  env:
9
- - OCAML_VERSION=4.05.0 OPAM_VERSION=1.2.2
9
+ - OCAML_VERSION=4.06.0 OPAM_VERSION=1.2.2
@@ -11,7 +11,7 @@ notes contain a few details specific to Ocaml.
11
11
 
12
12
  ## Prerequisites
13
13
 
14
- The OCaml track assumes installation of OCaml version 4.05.0, and installation of Core, OUnit, and React (for the Hangman exercise).
14
+ The OCaml track assumes installation of OCaml version 4.06.0, and installation of Core, OUnit, and React (for the Hangman exercise).
15
15
  Assuming you have opam, these can be installed with
16
16
  ```bash
17
17
  opam install core ounit react
@@ -288,6 +288,16 @@
288
288
 
289
289
  ]
290
290
  },
291
+ {
292
+ "uuid": "a5d0488e-1a95-4896-8196-541d59dbcea1",
293
+ "slug": "acronym",
294
+ "core": false,
295
+ "unlocked_by": null,
296
+ "difficulty": 3,
297
+ "topics": [
298
+
299
+ ]
300
+ },
291
301
  {
292
302
  "uuid": "1d36c4df-a1c8-454c-b4ec-7bec3c1cbca3",
293
303
  "slug": "binary",
@@ -0,0 +1,4 @@
1
+ unit module Acronym:ver<1>;
2
+
3
+ sub abbreviate ($phrase) is export {
4
+ }
@@ -0,0 +1,5 @@
1
+ unit module Acronym:ver<1>;
2
+
3
+ sub abbreviate ($phrase) is export {
4
+ [~] $phrase.uc.comb(/\w+/).map: *.substr(0, 1);
5
+ }
@@ -0,0 +1,33 @@
1
+ # Acronym
2
+
3
+ Convert a phrase to its acronym.
4
+
5
+ Techies love their TLA (Three Letter Acronyms)!
6
+
7
+ Help generate some jargon by writing a program that converts a long name
8
+ like Portable Network Graphics to its acronym (PNG).
9
+
10
+ ## Resources
11
+
12
+ Remember to check out the Perl 6 [documentation](https://docs.perl6.org/) and
13
+ [resources](https://perl6.org/resources/) pages for information, tips, and
14
+ examples if you get stuck.
15
+
16
+ ## Running the tests
17
+
18
+ There is a test suite and module included with the exercise.
19
+ The test suite (a file with the extension `.t`) will attempt to run routines
20
+ from the module (a file with the extension `.pm6`).
21
+ Add/modify routines in the module so that the tests will pass! You can view the
22
+ test data by executing the command `perl6 --doc *.t` (\* being the name of the
23
+ test suite), and run the test suite for the exercise by executing the command
24
+ `prove . --exec=perl6` in the exercise directory.
25
+ You can also add the `-v` flag e.g. `prove . --exec=perl6 -v` to display all
26
+ tests, including any optional tests marked as 'TODO'.
27
+
28
+ ## Source
29
+
30
+ Julien Vanier [https://github.com/monkbroc](https://github.com/monkbroc)
31
+
32
+ ## Submitting Incomplete Solutions
33
+ It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -0,0 +1,96 @@
1
+ #!/usr/bin/env perl6
2
+ use v6;
3
+ use Test;
4
+ use lib my $dir = $?FILE.IO.dirname;
5
+ use JSON::Fast;
6
+
7
+ my Str:D $exercise := 'Acronym';
8
+ my Version:D $version = v1;
9
+ my Str $module //= $exercise;
10
+ plan 8;
11
+
12
+ use-ok $module or bail-out;
13
+ require ::($module);
14
+
15
+ if ::($exercise).^ver !~~ $version {
16
+ warn "\nExercise version mismatch. Further tests may fail!"
17
+ ~ "\n$exercise is $(::($exercise).^ver.gist). "
18
+ ~ "Test is $($version.gist).\n";
19
+ bail-out 'Example version must match test version.' if %*ENV<EXERCISM>;
20
+ }
21
+
22
+ require ::($module) <&abbreviate>;
23
+
24
+ my $c-data = from-json $=pod.pop.contents;
25
+
26
+ for $c-data<cases>»<cases>».Array.flat {
27
+ is abbreviate(.<phrase>), |.<expected description>;
28
+ }
29
+
30
+ =head2 Canonical Data
31
+ =begin code
32
+
33
+ {
34
+ "exercise": "acronym",
35
+ "version": "1.1.0",
36
+ "cases": [
37
+ {
38
+ "description": "Abbreviate a phrase",
39
+ "cases": [
40
+ {
41
+ "description": "basic",
42
+ "property": "abbreviate",
43
+ "phrase": "Portable Network Graphics",
44
+ "expected": "PNG"
45
+ },
46
+ {
47
+ "description": "lowercase words",
48
+ "property": "abbreviate",
49
+ "phrase": "Ruby on Rails",
50
+ "expected": "ROR"
51
+ },
52
+ {
53
+ "description": "punctuation",
54
+ "property": "abbreviate",
55
+ "phrase": "First In, First Out",
56
+ "expected": "FIFO"
57
+ },
58
+ {
59
+ "description": "all caps words",
60
+ "property": "abbreviate",
61
+ "phrase": "PHP: Hypertext Preprocessor",
62
+ "expected": "PHP"
63
+ },
64
+ {
65
+ "description": "non-acronym all caps word",
66
+ "property": "abbreviate",
67
+ "phrase": "GNU Image Manipulation Program",
68
+ "expected": "GIMP"
69
+ },
70
+ {
71
+ "description": "hyphenated",
72
+ "property": "abbreviate",
73
+ "phrase": "Complementary metal-oxide semiconductor",
74
+ "expected": "CMOS"
75
+ }
76
+ ]
77
+ }
78
+ ]
79
+ }
80
+
81
+ =end code
82
+
83
+ unless %*ENV<EXERCISM> {
84
+ skip-rest 'exercism tests';
85
+ exit;
86
+ }
87
+
88
+ subtest 'canonical-data' => {
89
+ (my $c-data-file = "$dir/../../problem-specifications/exercises/{
90
+ $dir.IO.resolve.basename
91
+ }/canonical-data.json".IO.resolve) ~~ :f ??
92
+ is-deeply $c-data, EVAL('from-json $c-data-file.slurp'), 'match problem-specifications' !!
93
+ flunk 'problem-specifications file not found';
94
+ }
95
+
96
+ INIT { $module = 'Example' if %*ENV<EXERCISM> }