trackler 2.1.0.24 → 2.1.0.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (336) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +3 -0
  3. data/CONTRIBUTING.md +5 -8
  4. data/README.md +7 -7
  5. data/common/CONTRIBUTING.md +0 -5
  6. data/common/exercises/accumulate/description.md +4 -1
  7. data/common/exercises/acronym/description.md +1 -1
  8. data/common/exercises/bank-account/description.md +2 -1
  9. data/common/exercises/book-store/description.md +2 -5
  10. data/common/exercises/bracket-push/description.md +2 -4
  11. data/common/exercises/change/description.md +2 -5
  12. data/common/exercises/circular-buffer/description.md +0 -2
  13. data/common/exercises/clock/description.md +0 -2
  14. data/common/exercises/collatz-conjecture/canonical-data.json +36 -0
  15. data/common/exercises/collatz-conjecture/description.md +25 -0
  16. data/common/exercises/collatz-conjecture/metadata.yml +4 -0
  17. data/common/exercises/counter/description.md +1 -2
  18. data/common/exercises/diamond/description.md +0 -4
  19. data/common/exercises/flatten-array/description.md +1 -1
  20. data/common/exercises/grade-school/description.md +2 -1
  21. data/common/exercises/grains/description.md +2 -1
  22. data/common/exercises/grep/description.md +3 -2
  23. data/common/exercises/kindergarten-garden/description.md +2 -1
  24. data/common/exercises/largest-series-product/description.md +2 -1
  25. data/common/exercises/matrix/description.md +2 -1
  26. data/common/exercises/nucleotide-codons/description.md +2 -1
  27. data/common/exercises/ocr-numbers/description.md +2 -1
  28. data/common/exercises/octal/description.md +3 -1
  29. data/common/exercises/pangram/description.md +2 -1
  30. data/common/exercises/perfect-numbers/description.md +2 -1
  31. data/common/exercises/poker/description.md +0 -2
  32. data/common/exercises/protein-translation/description.md +3 -2
  33. data/common/exercises/proverb/description.md +2 -1
  34. data/common/exercises/pythagorean-triplet/description.md +4 -2
  35. data/common/exercises/queen-attack/description.md +2 -1
  36. data/common/exercises/rectangles/description.md +1 -3
  37. data/common/exercises/rotational-cipher/description.md +0 -4
  38. data/common/exercises/scale-generator/description.md +0 -2
  39. data/common/exercises/secret-handshake/description.md +2 -2
  40. data/common/exercises/series/description.md +2 -1
  41. data/common/exercises/sieve/description.md +2 -1
  42. data/common/exercises/space-age/description.md +0 -2
  43. data/common/exercises/strain/description.md +4 -5
  44. data/common/exercises/sublist/description.md +3 -6
  45. data/common/exercises/sum-of-multiples/description.md +2 -1
  46. data/common/exercises/tournament/description.md +4 -3
  47. data/common/exercises/transpose/description.md +1 -3
  48. data/common/exercises/trinary/description.md +2 -1
  49. data/common/exercises/two-bucket/description.md +1 -3
  50. data/common/exercises/two-fer/canonical-data.json +24 -0
  51. data/common/exercises/two-fer/description.md +40 -0
  52. data/common/exercises/two-fer/metadata.yml +4 -0
  53. data/common/exercises/word-search/description.md +2 -4
  54. data/common/exercises/zebra-puzzle/description.md +1 -1
  55. data/lib/trackler.rb +10 -5
  56. data/lib/trackler/description.rb +2 -2
  57. data/lib/trackler/guaranteed_file.rb +15 -15
  58. data/lib/trackler/implementation.rb +5 -5
  59. data/lib/trackler/implementations.rb +2 -2
  60. data/lib/trackler/metadata.rb +2 -2
  61. data/lib/trackler/problem.rb +2 -96
  62. data/lib/trackler/problems.rb +3 -48
  63. data/lib/trackler/specification.rb +101 -0
  64. data/lib/trackler/specifications.rb +52 -0
  65. data/lib/trackler/track.rb +6 -4
  66. data/lib/trackler/version.rb +1 -1
  67. data/tracks/bash/LICENSE +21 -0
  68. data/tracks/bash/README.md +0 -5
  69. data/tracks/c/LICENSE +21 -0
  70. data/tracks/c/README.md +0 -5
  71. data/tracks/clojure/LICENSE +2 -2
  72. data/tracks/clojure/README.org +0 -5
  73. data/tracks/clojure/config.json +5 -0
  74. data/tracks/clojure/exercises/sublist/project.clj +4 -0
  75. data/tracks/clojure/exercises/sublist/src/example.clj +19 -0
  76. data/tracks/clojure/exercises/sublist/sublist.mustache +9 -0
  77. data/tracks/clojure/exercises/sublist/test/sublist_test.clj +40 -0
  78. data/tracks/cpp/LICENSE +2 -2
  79. data/tracks/cpp/README.md +0 -5
  80. data/tracks/csharp/LICENSE +2 -2
  81. data/tracks/csharp/README.md +0 -5
  82. data/tracks/delphi/LICENSE +2 -2
  83. data/tracks/delphi/README.md +0 -5
  84. data/tracks/ecmascript/LICENSE +2 -2
  85. data/tracks/ecmascript/README.md +0 -5
  86. data/tracks/elisp/.travis.yml +7 -3
  87. data/tracks/elisp/LICENSE +2 -2
  88. data/tracks/elisp/README.org +3 -6
  89. data/tracks/elisp/bin/test-examples +27 -0
  90. data/tracks/elisp/config.json +10 -0
  91. data/tracks/elisp/docs/LEARNING.org +0 -3
  92. data/tracks/elisp/exercises/grains/example.el +18 -0
  93. data/tracks/elisp/exercises/grains/grains-test.el +38 -0
  94. data/tracks/elisp/exercises/grains/grains.el +10 -0
  95. data/tracks/elisp/exercises/phone-number/example.el +34 -0
  96. data/tracks/elisp/exercises/phone-number/phone-number-test.el +43 -0
  97. data/tracks/elisp/exercises/phone-number/phone-number.el +9 -0
  98. data/tracks/elixir/LICENSE +2 -2
  99. data/tracks/elixir/README.md +0 -5
  100. data/tracks/elm/LICENSE +2 -2
  101. data/tracks/elm/README.md +0 -5
  102. data/tracks/erlang/LICENSE +2 -2
  103. data/tracks/erlang/README.md +0 -5
  104. data/tracks/erlang/SETUP.md +7 -0
  105. data/tracks/erlang/exercises/rotational-cipher/rebar.config +5 -5
  106. data/tracks/erlang/exercises/rotational-cipher/test/rotational_cipher_tests.erl +18 -18
  107. data/tracks/factor/LICENSE +2 -2
  108. data/tracks/fortran/.github/PULL_REQUEST_TEMPLATE.md +23 -0
  109. data/tracks/fortran/.gitignore +4 -0
  110. data/tracks/fortran/.travis.yml +17 -0
  111. data/tracks/fortran/LICENSE +21 -0
  112. data/tracks/fortran/Makefile +40 -0
  113. data/tracks/fortran/README.md +72 -0
  114. data/tracks/fortran/bin/fetch-configlet +32 -0
  115. data/tracks/fortran/config.json +32 -0
  116. data/tracks/{kotlin/SETUP.md → fortran/docs/ABOUT.md} +0 -0
  117. data/tracks/fortran/docs/INSTALLATION.md +0 -0
  118. data/tracks/fortran/docs/LEARNING.md +0 -0
  119. data/tracks/fortran/docs/RESOURCES.md +0 -0
  120. data/tracks/fortran/docs/TESTS.md +0 -0
  121. data/tracks/fortran/exercises/TRACK_HINTS.md +0 -0
  122. data/tracks/fortran/exercises/bob/bob.fun +114 -0
  123. data/tracks/fortran/exercises/bob/example.f90 +61 -0
  124. data/tracks/fortran/exercises/hello_world/example.f90 +9 -0
  125. data/tracks/fortran/exercises/hello_world/hello_world.fun +10 -0
  126. data/tracks/fortran/img/.keep +0 -0
  127. data/tracks/fsharp/LICENSE +2 -2
  128. data/tracks/fsharp/README.md +0 -5
  129. data/tracks/go/LICENSE +2 -2
  130. data/tracks/go/README.md +0 -5
  131. data/tracks/haskell/LICENSE +2 -2
  132. data/tracks/haskell/README.md +0 -5
  133. data/tracks/idris/LICENSE +2 -2
  134. data/tracks/idris/README.md +0 -5
  135. data/tracks/java/LICENSE +2 -2
  136. data/tracks/java/README.md +0 -7
  137. data/tracks/java/{SETUP.md → TRACK_HINTS.md} +0 -0
  138. data/tracks/java/config.json +5 -0
  139. data/tracks/java/exercises/_template/build.gradle +1 -0
  140. data/tracks/java/exercises/accumulate/build.gradle +1 -0
  141. data/tracks/java/exercises/acronym/build.gradle +1 -0
  142. data/tracks/java/exercises/all-your-base/build.gradle +1 -0
  143. data/tracks/java/exercises/allergies/build.gradle +1 -0
  144. data/tracks/java/exercises/anagram/build.gradle +1 -0
  145. data/tracks/java/exercises/atbash-cipher/build.gradle +1 -0
  146. data/tracks/java/exercises/beer-song/build.gradle +1 -0
  147. data/tracks/java/exercises/binary-search/build.gradle +1 -0
  148. data/tracks/java/exercises/binary/build.gradle +1 -0
  149. data/tracks/java/exercises/bob/build.gradle +1 -0
  150. data/tracks/java/exercises/book-store/build.gradle +1 -0
  151. data/tracks/java/exercises/bracket-push/build.gradle +1 -0
  152. data/tracks/java/exercises/change/build.gradle +1 -0
  153. data/tracks/java/exercises/clock/build.gradle +2 -1
  154. data/tracks/java/exercises/collatz-conjecture/build.gradle +18 -0
  155. data/tracks/java/exercises/collatz-conjecture/src/example/java/CollatzCalculator.java +19 -0
  156. data/tracks/java/exercises/collatz-conjecture/src/main/java/CollatzCalculator.java +7 -0
  157. data/tracks/java/exercises/collatz-conjecture/src/test/java/CollatzCalculatorTest.java +59 -0
  158. data/tracks/java/exercises/crypto-square/build.gradle +1 -0
  159. data/tracks/java/exercises/diamond/build.gradle +1 -0
  160. data/tracks/java/exercises/diamond/src/example/java/DiamondPrinter.java +4 -4
  161. data/tracks/java/exercises/diamond/src/test/java/DiamondPrinterTest.java +6 -2
  162. data/tracks/java/exercises/difference-of-squares/build.gradle +1 -0
  163. data/tracks/java/exercises/difference-of-squares/src/main/java/.keep +0 -0
  164. data/tracks/java/exercises/etl/build.gradle +1 -0
  165. data/tracks/java/exercises/flatten-array/build.gradle +1 -0
  166. data/tracks/java/exercises/gigasecond/build.gradle +1 -0
  167. data/tracks/java/exercises/grade-school/build.gradle +1 -0
  168. data/tracks/java/exercises/hamming/build.gradle +1 -0
  169. data/tracks/java/exercises/hexadecimal/build.gradle +1 -0
  170. data/tracks/java/exercises/isogram/build.gradle +1 -0
  171. data/tracks/java/exercises/kindergarten-garden/build.gradle +1 -0
  172. data/tracks/java/exercises/largest-series-product/build.gradle +1 -0
  173. data/tracks/java/exercises/linked-list/build.gradle +1 -0
  174. data/tracks/java/exercises/luhn/build.gradle +1 -0
  175. data/tracks/java/exercises/matrix/build.gradle +2 -1
  176. data/tracks/java/exercises/meetup/build.gradle +1 -0
  177. data/tracks/java/exercises/minesweeper/build.gradle +1 -0
  178. data/tracks/java/exercises/nth-prime/build.gradle +1 -0
  179. data/tracks/java/exercises/ocr-numbers/build.gradle +1 -0
  180. data/tracks/java/exercises/octal/build.gradle +1 -0
  181. data/tracks/java/exercises/pangram/build.gradle +1 -0
  182. data/tracks/java/exercises/pascals-triangle/build.gradle +1 -0
  183. data/tracks/java/exercises/perfect-numbers/build.gradle +1 -0
  184. data/tracks/java/exercises/phone-number/build.gradle +1 -0
  185. data/tracks/java/exercises/pig-latin/build.gradle +1 -0
  186. data/tracks/java/exercises/queen-attack/build.gradle +1 -0
  187. data/tracks/java/exercises/raindrops/build.gradle +1 -0
  188. data/tracks/java/exercises/rectangles/build.gradle +1 -0
  189. data/tracks/java/exercises/rna-transcription/build.gradle +1 -0
  190. data/tracks/java/exercises/robot-simulator/build.gradle +1 -0
  191. data/tracks/java/exercises/roman-numerals/build.gradle +1 -0
  192. data/tracks/java/exercises/run-length-encoding/build.gradle +1 -0
  193. data/tracks/java/exercises/saddle-points/build.gradle +1 -0
  194. data/tracks/java/exercises/scrabble-score/build.gradle +1 -0
  195. data/tracks/java/exercises/secret-handshake/build.gradle +1 -0
  196. data/tracks/java/exercises/series/build.gradle +1 -0
  197. data/tracks/java/exercises/settings.gradle +1 -0
  198. data/tracks/java/exercises/sieve/build.gradle +1 -0
  199. data/tracks/java/exercises/simple-cipher/build.gradle +1 -0
  200. data/tracks/java/exercises/simple-linked-list/build.gradle +1 -0
  201. data/tracks/java/exercises/space-age/build.gradle +1 -0
  202. data/tracks/java/exercises/strain/build.gradle +1 -0
  203. data/tracks/java/exercises/sublist/build.gradle +1 -0
  204. data/tracks/java/exercises/sum-of-multiples/build.gradle +1 -0
  205. data/tracks/java/exercises/triangle/build.gradle +1 -0
  206. data/tracks/java/exercises/trinary/build.gradle +1 -0
  207. data/tracks/java/exercises/twelve-days/build.gradle +2 -1
  208. data/tracks/java/exercises/word-count/build.gradle +1 -0
  209. data/tracks/java/exercises/wordy/build.gradle +1 -0
  210. data/tracks/javascript/LICENSE +2 -2
  211. data/tracks/javascript/README.md +0 -5
  212. data/tracks/julia/LICENSE +2 -2
  213. data/tracks/kotlin/LICENSE +2 -2
  214. data/tracks/kotlin/README.md +0 -7
  215. data/tracks/kotlin/TRACK_HINTS.md +1 -0
  216. data/tracks/kotlin/exercises/phone-number/src/example/kotlin/PhoneNumber.kt +1 -1
  217. data/tracks/kotlin/exercises/phone-number/src/test/kotlin/PhoneNumberTest.kt +7 -8
  218. data/tracks/kotlin/exercises/rna-transcription/src/test/kotlin/RnaTranscriptionTest.kt +6 -6
  219. data/tracks/lfe/LICENSE +2 -2
  220. data/tracks/lfe/README.md +0 -5
  221. data/tracks/lisp/LICENSE +2 -2
  222. data/tracks/lisp/README.md +0 -5
  223. data/tracks/lua/LICENSE +2 -2
  224. data/tracks/lua/README.md +0 -5
  225. data/tracks/mips/LICENSE +2 -2
  226. data/tracks/mips/README.md +0 -5
  227. data/tracks/objective-c/LICENSE +2 -2
  228. data/tracks/objective-c/README.md +0 -5
  229. data/tracks/ocaml/LICENSE +2 -2
  230. data/tracks/ocaml/README.md +0 -5
  231. data/tracks/ocaml/config.json +54 -25
  232. data/tracks/ocaml/exercises/forth/.merlin +5 -0
  233. data/tracks/ocaml/exercises/forth/Makefile +11 -0
  234. data/tracks/ocaml/exercises/forth/example.ml +89 -0
  235. data/tracks/ocaml/exercises/forth/forth.mli +1 -0
  236. data/tracks/ocaml/exercises/forth/test.ml +147 -0
  237. data/tracks/ocaml/exercises/react/.merlin +5 -0
  238. data/tracks/ocaml/exercises/react/HINT.md +3 -0
  239. data/tracks/ocaml/exercises/react/Makefile +11 -0
  240. data/tracks/ocaml/exercises/react/example.ml +106 -0
  241. data/tracks/ocaml/exercises/react/react.mli +26 -0
  242. data/tracks/ocaml/exercises/react/test.ml +157 -0
  243. data/tracks/ocaml/tools/test-generator/src/special_cases.ml +5 -2
  244. data/tracks/ocaml/tools/test-generator/templates/forth/template.ml +114 -0
  245. data/tracks/perl5/LICENSE +2 -2
  246. data/tracks/perl6/LICENSE +2 -2
  247. data/tracks/perl6/README.md +0 -5
  248. data/tracks/perl6/config.json +5 -0
  249. data/tracks/perl6/exercises/clock/Example.pm6 +2 -2
  250. data/tracks/perl6/exercises/flatten-array/Example.pm6 +13 -0
  251. data/tracks/perl6/exercises/flatten-array/FlattenArray.pm6 +4 -0
  252. data/tracks/perl6/exercises/flatten-array/example.yaml +6 -0
  253. data/tracks/perl6/exercises/flatten-array/flatten-array.t +80 -0
  254. data/tracks/php/LICENSE +2 -2
  255. data/tracks/php/README.md +0 -5
  256. data/tracks/powershell/.travis.yml +1 -0
  257. data/tracks/python/LICENSE +2 -2
  258. data/tracks/python/README.md +0 -5
  259. data/tracks/python/config.json +8 -0
  260. data/tracks/python/exercises/protein-translation/example.py +25 -0
  261. data/tracks/python/exercises/protein-translation/protein_translation.py +6 -0
  262. data/tracks/python/exercises/protein-translation/protein_translation_test.py +59 -0
  263. data/tracks/r/LICENSE +2 -2
  264. data/tracks/r/README.md +0 -5
  265. data/tracks/racket/LICENSE +2 -2
  266. data/tracks/racket/README.md +0 -5
  267. data/tracks/racket/config.json +5 -0
  268. data/tracks/racket/exercises/acronym/acronym-test.rkt +40 -0
  269. data/tracks/racket/exercises/acronym/acronym.rkt +3 -0
  270. data/tracks/racket/exercises/acronym/example.rkt +25 -0
  271. data/tracks/racket/exercises/grep/example.rkt +60 -26
  272. data/tracks/racket/exercises/grep/grep-test.rkt +154 -17
  273. data/tracks/racket/exercises/grep/grep.rkt +1 -18
  274. data/tracks/racket/exercises/grep/iliad.txt +9 -0
  275. data/tracks/racket/exercises/grep/midsummer-night.txt +7 -0
  276. data/tracks/racket/exercises/grep/paradise-lost.txt +8 -0
  277. data/tracks/ruby/README.md +4 -1
  278. data/tracks/ruby/exercises/acronym/.meta/.version +1 -1
  279. data/tracks/ruby/exercises/acronym/.meta/solutions/acronym.rb +1 -1
  280. data/tracks/ruby/exercises/acronym/acronym_test.rb +2 -7
  281. data/tracks/ruby/exercises/anagram/.meta/generator/anagram_case.rb +1 -1
  282. data/tracks/ruby/exercises/beer-song/.meta/generator/beer_song_case.rb +1 -1
  283. data/tracks/ruby/exercises/clock/.meta/generator/clock_case.rb +1 -1
  284. data/tracks/ruby/exercises/connect/.meta/generator/connect_case.rb +0 -3
  285. data/tracks/ruby/exercises/connect/.meta/generator/test_template.erb +1 -1
  286. data/tracks/ruby/exercises/difference-of-squares/.meta/.version +1 -1
  287. data/tracks/ruby/exercises/difference-of-squares/.meta/solutions/difference_of_squares.rb +1 -1
  288. data/tracks/ruby/exercises/difference-of-squares/difference_of_squares_test.rb +12 -17
  289. data/tracks/ruby/exercises/triangle/.meta/generator/triangle_case.rb +10 -2
  290. data/tracks/ruby/exercises/triangle/triangle_test.rb +17 -17
  291. data/tracks/ruby/exercises/wordy/.meta/generator/wordy_case.rb +1 -1
  292. data/tracks/ruby/lib/generator/case_values.rb +1 -1
  293. data/tracks/ruby/lib/generator/exercise_case.rb +16 -2
  294. data/tracks/ruby/lib/generator/exercise_case/assertion.rb +4 -4
  295. data/tracks/ruby/test/fixtures/xruby/exercises/alpha/.meta/generator/alpha_case.rb +1 -1
  296. data/tracks/ruby/test/generator/case_values_test.rb +28 -7
  297. data/tracks/ruby/test/generator/exercise_case/assertion_test.rb +7 -7
  298. data/tracks/ruby/test/generator/exercise_case_test.rb +21 -25
  299. data/tracks/ruby/test/wordy_cases_test.rb +4 -4
  300. data/tracks/rust/LICENSE +2 -2
  301. data/tracks/rust/README.md +0 -5
  302. data/tracks/rust/config.json +1 -0
  303. data/tracks/rust/exercises/etl/Cargo.toml +1 -1
  304. data/tracks/rust/exercises/etl/example.rs +2 -2
  305. data/tracks/rust/exercises/etl/tests/etl.rs +26 -32
  306. data/tracks/rust/exercises/forth/tests/forth.rs +20 -22
  307. data/tracks/rust/exercises/minesweeper/Cargo.toml +1 -1
  308. data/tracks/rust/exercises/minesweeper/example.rs +3 -0
  309. data/tracks/rust/exercises/minesweeper/tests/minesweeper.rs +44 -46
  310. data/tracks/rust/exercises/raindrops/Cargo.toml +1 -1
  311. data/tracks/rust/exercises/raindrops/tests/raindrops.rs +12 -0
  312. data/tracks/rust/exercises/rna-transcription/Cargo.toml +1 -1
  313. data/tracks/rust/exercises/rna-transcription/example.rs +13 -9
  314. data/tracks/rust/exercises/rna-transcription/tests/rna-transcription.rs +23 -5
  315. data/tracks/scala/LICENSE +2 -2
  316. data/tracks/scala/README.md +0 -5
  317. data/tracks/scheme/LICENSE +2 -2
  318. data/tracks/scheme/README.org +0 -6
  319. data/tracks/swift/Dangerfile +1 -1
  320. data/tracks/swift/LICENSE +2 -2
  321. data/tracks/swift/README.md +0 -6
  322. data/tracks/vbnet/.travis.yml +1 -0
  323. data/tracks/vimscript/.travis.yml +4 -0
  324. data/tracks/vimscript/.vintrc.yaml +5 -0
  325. data/tracks/vimscript/TRACK_HINTS.md +19 -1
  326. data/tracks/vimscript/bin/pre-push +18 -0
  327. data/tracks/vimscript/config.json +8 -1
  328. data/tracks/vimscript/docs/ABOUT.md +7 -6
  329. data/tracks/vimscript/docs/TESTS.md +4 -4
  330. data/tracks/vimscript/exercises/allergies/allergies.vader +68 -0
  331. data/tracks/vimscript/exercises/allergies/allergies.vim +29 -0
  332. data/tracks/vimscript/exercises/allergies/example.vim +23 -0
  333. data/tracks/vimscript/lib/generate.vim +89 -0
  334. metadata +81 -6
  335. data/tracks/java/exercises/difference-of-squares/src/main/java/DifferenceOfSquaresCalculator.java +0 -15
  336. data/tracks/ocaml/.vscode/launch.json +0 -13
@@ -0,0 +1,9 @@
1
+ module hello_world
2
+ contains
3
+ function hello()
4
+ character(12) :: hello
5
+ hello = 'Hello World'
6
+
7
+ end function hello
8
+
9
+ end module hello_world
@@ -0,0 +1,10 @@
1
+ test_suite hello_world
2
+
3
+ setup
4
+ end setup
5
+
6
+ test say_hi
7
+ assert_equal( 'Hello World' , hello() )
8
+ end test
9
+
10
+ end test_suite
File without changes
@@ -1,6 +1,6 @@
1
- The MIT License (MIT)
1
+ MIT License
2
2
 
3
- Copyright (c) 2014 Katrina Owen, _@kytrinyx.com
3
+ Copyright (c) 2017 Exercism, Inc
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -13,11 +13,6 @@ We have a [gitter channel](https://gitter.im/exercism/xfsharp) where you can get
13
13
 
14
14
  Please see the [contributing guide](https://github.com/exercism/x-api/blob/master/CONTRIBUTING.md#the-exercise-data)
15
15
 
16
- ## License
17
-
18
- The MIT License (MIT)
19
-
20
- Copyright (c) 2014 Katrina Owen, _@kytrinyx.com
21
16
 
22
17
  ### F# icon
23
18
  The F# Software Foundation logo for F# is an asset of the F# Software Foundation. We have adapted it --changing the color-- with permission.
data/tracks/go/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
- The MIT License (MIT)
1
+ MIT License
2
2
 
3
- Copyright (c) 2014 Katrina Owen, _@kytrinyx.com
3
+ Copyright (c) 2017 Exercism, Inc
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/tracks/go/README.md CHANGED
@@ -243,11 +243,6 @@ for clues. Usually error messages will be helpful and you can correct the probl
243
243
  Directions are unlimited. This code is fresh and evolving. Explore the existing code and you will see some new
244
244
  directions being tried. Your fresh ideas and contributions are welcome. :sparkles:
245
245
 
246
- ## License
247
-
248
- The MIT License (MIT)
249
-
250
- Copyright (c) 2014 Katrina Owen, _@kytrinyx.com
251
246
 
252
247
  ### Go icon
253
248
  The Go logo was designed by Renée French, and has been released under the Creative Commons 3.0 Attributions license.
@@ -1,6 +1,6 @@
1
- The MIT License (MIT)
1
+ MIT License
2
2
 
3
- Copyright (c) 2014 Katrina Owen, _@kytrinyx.com
3
+ Copyright (c) 2017 Exercism, Inc
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -165,11 +165,6 @@ If you are certain that a suggestion given by `hlint` would make the
165
165
  code worse, you can [suppress it](https://github.com/ndmitchell/hlint#customizing-the-hints)
166
166
  with annotations in the source file.
167
167
 
168
- ## License
169
-
170
- The MIT License (MIT)
171
-
172
- Copyright (c) 2014 Katrina Owen, _@kytrinyx.com
173
168
 
174
169
  ### Haskell icon
175
170
  The Haskell icon was designed by Darrin Thompson and Jeff Wheeler. It was released under the [HaskellWiki license](https://wiki.haskell.org/HaskellWiki:Copyrights).
data/tracks/idris/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
- The MIT License (MIT)
1
+ MIT License
2
2
 
3
- Copyright (c) 2016 Katrina Owen, _@kytrinyx.com
3
+ Copyright (c) 2017 Exercism, Inc
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -10,9 +10,4 @@ _Document how to contribute to the Idris track._
10
10
 
11
11
  Please see the [contributing guide](https://github.com/exercism/x-api/blob/master/CONTRIBUTING.md#the-exercise-data)
12
12
 
13
- ## License
14
-
15
- The MIT License (MIT)
16
-
17
- Copyright (c) 2016 Katrina Owen, _@kytrinyx.com
18
13
 
data/tracks/java/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
- The MIT License (MIT)
1
+ MIT License
2
2
 
3
- Copyright (c) 2014 Katrina Owen, _@kytrinyx.com
3
+ Copyright (c) 2017 Exercism, Inc
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -117,10 +117,3 @@ gradle clean
117
117
  cd ~/workspace/exercism/exercises
118
118
  exercism fetch java bob
119
119
  ```
120
-
121
-
122
- # License
123
-
124
- The MIT License (MIT)
125
-
126
- Copyright (c) 2014 Katrina Owen, _@kytrinyx.com
File without changes
@@ -95,6 +95,11 @@
95
95
  "difficulty": 4,
96
96
  "topics": []
97
97
  },
98
+ {
99
+ "slug": "collatz-conjecture",
100
+ "difficulty": 4,
101
+ "topics": []
102
+ },
98
103
  {
99
104
  "slug": "nth-prime",
100
105
  "difficulty": 4,
@@ -9,6 +9,7 @@ repositories {
9
9
  dependencies {
10
10
  testCompile "junit:junit:4.12"
11
11
  }
12
+
12
13
  test {
13
14
  testLogging {
14
15
  exceptionFormat = 'full'
@@ -9,6 +9,7 @@ repositories {
9
9
  dependencies {
10
10
  testCompile "junit:junit:4.12"
11
11
  }
12
+
12
13
  test {
13
14
  testLogging {
14
15
  exceptionFormat = 'full'
@@ -9,6 +9,7 @@ repositories {
9
9
  dependencies {
10
10
  testCompile "junit:junit:4.12"
11
11
  }
12
+
12
13
  test {
13
14
  testLogging {
14
15
  exceptionFormat = 'full'
@@ -9,6 +9,7 @@ repositories {
9
9
  dependencies {
10
10
  testCompile "junit:junit:4.12"
11
11
  }
12
+
12
13
  test {
13
14
  testLogging {
14
15
  exceptionFormat = 'full'
@@ -9,6 +9,7 @@ repositories {
9
9
  dependencies {
10
10
  testCompile "junit:junit:4.12"
11
11
  }
12
+
12
13
  test {
13
14
  testLogging {
14
15
  exceptionFormat = 'full'
@@ -9,6 +9,7 @@ repositories {
9
9
  dependencies {
10
10
  testCompile "junit:junit:4.12"
11
11
  }
12
+
12
13
  test {
13
14
  testLogging {
14
15
  exceptionFormat = 'full'
@@ -9,6 +9,7 @@ repositories {
9
9
  dependencies {
10
10
  testCompile "junit:junit:4.12"
11
11
  }
12
+
12
13
  test {
13
14
  testLogging {
14
15
  exceptionFormat = 'full'
@@ -9,6 +9,7 @@ repositories {
9
9
  dependencies {
10
10
  testCompile "junit:junit:4.12"
11
11
  }
12
+
12
13
  test {
13
14
  testLogging {
14
15
  exceptionFormat = 'full'
@@ -9,6 +9,7 @@ repositories {
9
9
  dependencies {
10
10
  testCompile "junit:junit:4.12"
11
11
  }
12
+
12
13
  test {
13
14
  testLogging {
14
15
  exceptionFormat = 'full'
@@ -9,6 +9,7 @@ repositories {
9
9
  dependencies {
10
10
  testCompile "junit:junit:4.12"
11
11
  }
12
+
12
13
  test {
13
14
  testLogging {
14
15
  exceptionFormat = 'full'
@@ -9,6 +9,7 @@ repositories {
9
9
  dependencies {
10
10
  testCompile "junit:junit:4.12"
11
11
  }
12
+
12
13
  test {
13
14
  testLogging {
14
15
  exceptionFormat = 'full'
@@ -9,6 +9,7 @@ repositories {
9
9
  dependencies {
10
10
  testCompile "junit:junit:4.12"
11
11
  }
12
+
12
13
  test {
13
14
  testLogging {
14
15
  exceptionFormat = 'full'
@@ -9,6 +9,7 @@ repositories {
9
9
  dependencies {
10
10
  testCompile "junit:junit:4.12"
11
11
  }
12
+
12
13
  test {
13
14
  testLogging {
14
15
  exceptionFormat = 'full'
@@ -9,6 +9,7 @@ repositories {
9
9
  dependencies {
10
10
  testCompile "junit:junit:4.12"
11
11
  }
12
+
12
13
  test {
13
14
  testLogging {
14
15
  exceptionFormat = 'full'
@@ -9,9 +9,10 @@ repositories {
9
9
  dependencies {
10
10
  testCompile "junit:junit:4.12"
11
11
  }
12
+
12
13
  test {
13
14
  testLogging {
14
15
  exceptionFormat = 'full'
15
16
  events = ["passed", "failed", "skipped"]
16
17
  }
17
- }
18
+ }
@@ -0,0 +1,18 @@
1
+ apply plugin: "java"
2
+ apply plugin: "eclipse"
3
+ apply plugin: "idea"
4
+
5
+ repositories {
6
+ mavenCentral()
7
+ }
8
+
9
+ dependencies {
10
+ testCompile "junit:junit:4.12"
11
+ }
12
+
13
+ test {
14
+ testLogging {
15
+ exceptionFormat = 'full'
16
+ events = ["passed", "failed", "skipped"]
17
+ }
18
+ }
@@ -0,0 +1,19 @@
1
+ class CollatzCalculator {
2
+
3
+ int computeStepCount(final int start) {
4
+ if (start <= 0) throw new IllegalArgumentException("Only natural numbers are allowed");
5
+
6
+ if (start == 1) return 0;
7
+
8
+ final int next;
9
+
10
+ if (start % 2 == 0) {
11
+ next = start / 2;
12
+ } else {
13
+ next = 3 * start + 1;
14
+ }
15
+
16
+ return 1 + computeStepCount(next);
17
+ }
18
+
19
+ }
@@ -0,0 +1,7 @@
1
+ class CollatzCalculator {
2
+
3
+ int computeStepCount(int start) {
4
+ throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
5
+ }
6
+
7
+ }
@@ -0,0 +1,59 @@
1
+ import org.junit.Before;
2
+ import org.junit.Ignore;
3
+ import org.junit.Rule;
4
+ import org.junit.Test;
5
+ import org.junit.rules.ExpectedException;
6
+
7
+ import static org.junit.Assert.assertEquals;
8
+
9
+ /*
10
+ * version: 1.0.0
11
+ */
12
+ public class CollatzCalculatorTest {
13
+
14
+ @Rule
15
+ public ExpectedException expectedException = ExpectedException.none();
16
+
17
+ private CollatzCalculator collatzCalculator;
18
+
19
+ @Before
20
+ public void setUp() {
21
+ collatzCalculator = new CollatzCalculator();
22
+ }
23
+
24
+ @Test
25
+ public void testZeroStepsRequiredWhenStartingFrom1() {
26
+ assertEquals(0, collatzCalculator.computeStepCount(1));
27
+ }
28
+
29
+ @Ignore("Remove to run test")
30
+ @Test
31
+ public void testCorrectNumberOfStepsWhenAllStepsAreDivisions() {
32
+ assertEquals(4, collatzCalculator.computeStepCount(16));
33
+ }
34
+
35
+ @Ignore("Remove to run test")
36
+ @Test
37
+ public void testCorrectNumberOfStepsWhenBothStepTypesAreNeeded() {
38
+ assertEquals(9, collatzCalculator.computeStepCount(12));
39
+ }
40
+
41
+ @Ignore("Remove to run test")
42
+ @Test
43
+ public void testZeroIsConsideredInvalidInput() {
44
+ expectedException.expect(IllegalArgumentException.class);
45
+ expectedException.expectMessage("Only natural numbers are allowed");
46
+
47
+ collatzCalculator.computeStepCount(0);
48
+ }
49
+
50
+ @Ignore("Remove to run test")
51
+ @Test
52
+ public void testNegativeIntegerIsConsideredInvalidInput() {
53
+ expectedException.expect(IllegalArgumentException.class);
54
+ expectedException.expectMessage("Only natural numbers are allowed");
55
+
56
+ collatzCalculator.computeStepCount(-15);
57
+ }
58
+
59
+ }
@@ -9,6 +9,7 @@ repositories {
9
9
  dependencies {
10
10
  testCompile "junit:junit:4.12"
11
11
  }
12
+
12
13
  test {
13
14
  testLogging {
14
15
  exceptionFormat = 'full'
@@ -9,6 +9,7 @@ repositories {
9
9
  dependencies {
10
10
  testCompile "junit:junit:4.12"
11
11
  }
12
+
12
13
  test {
13
14
  testLogging {
14
15
  exceptionFormat = 'full'
@@ -17,7 +17,7 @@ final class DiamondPrinter {
17
17
  List<String> printToList(final char chr) {
18
18
  final int nRows = 2 * ((int) chr - A_INT) + 1;
19
19
 
20
- final List<String> topRows = new ArrayList<>();
20
+ final List<String> result = new ArrayList<>();
21
21
 
22
22
  // Populate the top rows.
23
23
  for (int nRow = 0; nRow < (nRows + 1) / 2; nRow++) {
@@ -27,15 +27,15 @@ final class DiamondPrinter {
27
27
  final String rightHalfOfRow = reverse(leftHalfOfRow.substring(0, leftHalfOfRow.length() - 1));
28
28
  final String fullRow = leftHalfOfRow + rightHalfOfRow;
29
29
 
30
- topRows.add(fullRow);
30
+ result.add(fullRow);
31
31
  }
32
32
 
33
33
  // Populate the bottom rows by 'reflecting' the top rows.
34
34
  for (int nRow = (nRows - 1) / 2 - 1; nRow >= 0; nRow--) {
35
- topRows.add(topRows.get(nRow));
35
+ result.add(result.get(nRow));
36
36
  }
37
37
 
38
- return topRows;
38
+ return result;
39
39
  }
40
40
 
41
41
  }