trackler 2.2.1.33 → 2.2.1.34

Sign up to get free protection for your applications and to get access to all the features.
Files changed (267) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/README.md +1 -1
  4. data/problem-specifications/exercises/palindrome-products/description.md +9 -3
  5. data/tracks/c/exercises/hamming/src/example.c +9 -8
  6. data/tracks/c/exercises/hamming/src/example.h +1 -1
  7. data/tracks/c/exercises/hamming/test/test_hamming.c +31 -7
  8. data/tracks/clojure/config.json +10 -0
  9. data/tracks/clojure/exercises/collatz-conjecture/README.md +34 -0
  10. data/tracks/clojure/exercises/collatz-conjecture/project.clj +4 -0
  11. data/tracks/clojure/exercises/collatz-conjecture/src/collatz_conjecture.clj +3 -0
  12. data/tracks/clojure/exercises/collatz-conjecture/src/example.clj +13 -0
  13. data/tracks/clojure/exercises/collatz-conjecture/test/collatz_conjecture_test.clj +29 -0
  14. data/tracks/coldfusion/.gitignore +1 -0
  15. data/tracks/coldfusion/.travis.yml +16 -4
  16. data/tracks/coldfusion/CONTRIBUTING.md +10 -0
  17. data/tracks/coldfusion/README.md +85 -6
  18. data/tracks/coldfusion/config.json +195 -10
  19. data/tracks/coldfusion/config/maintainers.json +8 -1
  20. data/tracks/coldfusion/docs/ABOUT.md +8 -0
  21. data/tracks/coldfusion/docs/EXERCISE_README_INSERT.md +15 -0
  22. data/tracks/coldfusion/docs/INSTALLATION.md +35 -0
  23. data/tracks/coldfusion/docs/LEARNING.md +37 -0
  24. data/tracks/coldfusion/docs/RESOURCES.md +29 -0
  25. data/tracks/coldfusion/docs/SNIPPET.txt +8 -0
  26. data/tracks/coldfusion/docs/TESTS.md +19 -0
  27. data/tracks/coldfusion/exercises/acronym/.meta/HINTS.md +0 -0
  28. data/tracks/coldfusion/exercises/acronym/Acronym.cfc +13 -0
  29. data/tracks/coldfusion/exercises/acronym/AcronymTest.cfc +43 -0
  30. data/tracks/coldfusion/exercises/acronym/Solution.cfc +22 -0
  31. data/tracks/coldfusion/exercises/acronym/SolutionTest.cfc +7 -0
  32. data/tracks/coldfusion/exercises/acronym/TestRunner.cfc +103 -0
  33. data/tracks/coldfusion/exercises/acronym/box.json +8 -0
  34. data/tracks/coldfusion/exercises/acronym/index.cfm +37 -0
  35. data/tracks/coldfusion/exercises/atbash-cipher/.meta/HINTS.md +0 -0
  36. data/tracks/coldfusion/exercises/atbash-cipher/AtbashCipher.cfc +14 -0
  37. data/tracks/coldfusion/exercises/atbash-cipher/AtbashCipherTest.cfc +71 -0
  38. data/tracks/coldfusion/exercises/atbash-cipher/Solution.cfc +56 -0
  39. data/tracks/coldfusion/exercises/atbash-cipher/SolutionTest.cfc +7 -0
  40. data/tracks/coldfusion/exercises/atbash-cipher/TestRunner.cfc +103 -0
  41. data/tracks/coldfusion/exercises/atbash-cipher/box.json +8 -0
  42. data/tracks/coldfusion/exercises/atbash-cipher/index.cfm +37 -0
  43. data/tracks/coldfusion/exercises/diamond/.meta/HINTS.md +0 -0
  44. data/tracks/coldfusion/exercises/diamond/Diamond.cfc +13 -0
  45. data/tracks/coldfusion/exercises/diamond/DiamondTest.cfc +35 -0
  46. data/tracks/coldfusion/exercises/diamond/Solution.cfc +35 -0
  47. data/tracks/coldfusion/exercises/diamond/SolutionTest.cfc +7 -0
  48. data/tracks/coldfusion/exercises/diamond/TestRunner.cfc +103 -0
  49. data/tracks/coldfusion/exercises/diamond/box.json +8 -0
  50. data/tracks/coldfusion/exercises/diamond/index.cfm +37 -0
  51. data/tracks/coldfusion/exercises/difference-of-squares/.meta/HINTS.md +0 -0
  52. data/tracks/coldfusion/exercises/difference-of-squares/DifferenceOfSquares.cfc +18 -0
  53. data/tracks/coldfusion/exercises/difference-of-squares/DifferenceOfSquaresTest.cfc +63 -0
  54. data/tracks/coldfusion/exercises/difference-of-squares/Solution.cfc +28 -0
  55. data/tracks/coldfusion/exercises/difference-of-squares/SolutionTest.cfc +7 -0
  56. data/tracks/coldfusion/exercises/difference-of-squares/TestRunner.cfc +103 -0
  57. data/tracks/coldfusion/exercises/difference-of-squares/box.json +8 -0
  58. data/tracks/coldfusion/exercises/difference-of-squares/index.cfm +37 -0
  59. data/tracks/coldfusion/exercises/flatten-array/.meta/HINTS.md +0 -0
  60. data/tracks/coldfusion/exercises/flatten-array/FlattenArray.cfc +13 -0
  61. data/tracks/coldfusion/exercises/flatten-array/FlattenArrayTest.cfc +42 -0
  62. data/tracks/coldfusion/exercises/flatten-array/Solution.cfc +26 -0
  63. data/tracks/coldfusion/exercises/flatten-array/SolutionTest.cfc +7 -0
  64. data/tracks/coldfusion/exercises/flatten-array/TestRunner.cfc +103 -0
  65. data/tracks/coldfusion/exercises/flatten-array/box.json +8 -0
  66. data/tracks/coldfusion/exercises/flatten-array/index.cfm +37 -0
  67. data/tracks/coldfusion/exercises/gigasecond/.meta/HINTS.md +0 -0
  68. data/tracks/coldfusion/exercises/gigasecond/Gigasecond.cfc +13 -0
  69. data/tracks/coldfusion/exercises/gigasecond/GigasecondTest.cfc +39 -0
  70. data/tracks/coldfusion/exercises/gigasecond/Solution.cfc +16 -0
  71. data/tracks/coldfusion/exercises/gigasecond/SolutionTest.cfc +7 -0
  72. data/tracks/coldfusion/exercises/gigasecond/TestRunner.cfc +103 -0
  73. data/tracks/coldfusion/exercises/gigasecond/box.json +8 -0
  74. data/tracks/coldfusion/exercises/gigasecond/index.cfm +37 -0
  75. data/tracks/coldfusion/exercises/grains/.meta/HINTS.md +0 -0
  76. data/tracks/coldfusion/exercises/grains/Grains.cfc +14 -0
  77. data/tracks/coldfusion/exercises/grains/GrainsTest.cfc +63 -0
  78. data/tracks/coldfusion/exercises/grains/Solution.cfc +22 -0
  79. data/tracks/coldfusion/exercises/grains/SolutionTest.cfc +7 -0
  80. data/tracks/coldfusion/exercises/grains/TestRunner.cfc +103 -0
  81. data/tracks/coldfusion/exercises/grains/box.json +8 -0
  82. data/tracks/coldfusion/exercises/grains/index.cfm +37 -0
  83. data/tracks/coldfusion/exercises/hamming/.meta/HINTS.md +0 -0
  84. data/tracks/coldfusion/exercises/hamming/Hamming.cfc +13 -0
  85. data/tracks/coldfusion/exercises/hamming/HammingTest.cfc +75 -0
  86. data/tracks/coldfusion/exercises/hamming/Solution.cfc +25 -0
  87. data/tracks/coldfusion/exercises/hamming/SolutionTest.cfc +7 -0
  88. data/tracks/coldfusion/exercises/hamming/TestRunner.cfc +103 -0
  89. data/tracks/coldfusion/exercises/hamming/box.json +8 -0
  90. data/tracks/coldfusion/exercises/hamming/index.cfm +37 -0
  91. data/tracks/coldfusion/exercises/hello-world/HelloWorld.cfc +13 -0
  92. data/tracks/coldfusion/exercises/hello-world/HelloWorldTest.cfc +18 -0
  93. data/tracks/coldfusion/exercises/hello-world/Solution.cfc +13 -0
  94. data/tracks/coldfusion/exercises/hello-world/SolutionTest.cfc +7 -0
  95. data/tracks/coldfusion/exercises/hello-world/TestRunner.cfc +103 -0
  96. data/tracks/coldfusion/exercises/hello-world/box.json +8 -0
  97. data/tracks/coldfusion/exercises/hello-world/index.cfm +37 -0
  98. data/tracks/coldfusion/exercises/isogram/.meta/HINTS.md +0 -0
  99. data/tracks/coldfusion/exercises/isogram/Isogram.cfc +13 -0
  100. data/tracks/coldfusion/exercises/isogram/IsogramTest.cfc +55 -0
  101. data/tracks/coldfusion/exercises/isogram/Solution.cfc +23 -0
  102. data/tracks/coldfusion/exercises/isogram/SolutionTest.cfc +7 -0
  103. data/tracks/coldfusion/exercises/isogram/TestRunner.cfc +103 -0
  104. data/tracks/coldfusion/exercises/isogram/box.json +8 -0
  105. data/tracks/coldfusion/exercises/isogram/index.cfm +37 -0
  106. data/tracks/coldfusion/exercises/largest-series-product/.meta/HINTS.md +0 -0
  107. data/tracks/coldfusion/exercises/largest-series-product/LargestSeriesProduct.cfc +13 -0
  108. data/tracks/coldfusion/exercises/largest-series-product/LargestSeriesProductTest.cfc +75 -0
  109. data/tracks/coldfusion/exercises/largest-series-product/Solution.cfc +41 -0
  110. data/tracks/coldfusion/exercises/largest-series-product/SolutionTest.cfc +7 -0
  111. data/tracks/coldfusion/exercises/largest-series-product/TestRunner.cfc +103 -0
  112. data/tracks/coldfusion/exercises/largest-series-product/box.json +8 -0
  113. data/tracks/coldfusion/exercises/largest-series-product/index.cfm +37 -0
  114. data/tracks/coldfusion/exercises/leap/Leap.cfc +15 -0
  115. data/tracks/coldfusion/exercises/leap/LeapTest.cfc +39 -0
  116. data/tracks/coldfusion/exercises/leap/Solution.cfc +19 -0
  117. data/tracks/coldfusion/exercises/leap/SolutionTest.cfc +7 -0
  118. data/tracks/coldfusion/exercises/leap/TestRunner.cfc +103 -0
  119. data/tracks/coldfusion/exercises/leap/box.json +8 -0
  120. data/tracks/coldfusion/exercises/leap/index.cfm +37 -0
  121. data/tracks/coldfusion/exercises/luhn/.meta/HINTS.md +0 -0
  122. data/tracks/coldfusion/exercises/luhn/Luhn.cfc +13 -0
  123. data/tracks/coldfusion/exercises/luhn/LuhnTest.cfc +67 -0
  124. data/tracks/coldfusion/exercises/luhn/Solution.cfc +38 -0
  125. data/tracks/coldfusion/exercises/luhn/SolutionTest.cfc +7 -0
  126. data/tracks/coldfusion/exercises/luhn/TestRunner.cfc +103 -0
  127. data/tracks/coldfusion/exercises/luhn/box.json +8 -0
  128. data/tracks/coldfusion/exercises/luhn/index.cfm +37 -0
  129. data/tracks/coldfusion/exercises/nth-prime/.meta/HINTS.md +0 -0
  130. data/tracks/coldfusion/exercises/nth-prime/NthPrime.cfc +13 -0
  131. data/tracks/coldfusion/exercises/nth-prime/NthPrimeTest.cfc +35 -0
  132. data/tracks/coldfusion/exercises/nth-prime/Solution.cfc +33 -0
  133. data/tracks/coldfusion/exercises/nth-prime/SolutionTest.cfc +7 -0
  134. data/tracks/coldfusion/exercises/nth-prime/TestRunner.cfc +103 -0
  135. data/tracks/coldfusion/exercises/nth-prime/box.json +8 -0
  136. data/tracks/coldfusion/exercises/nth-prime/index.cfm +37 -0
  137. data/tracks/coldfusion/exercises/pangram/.meta/HINTS.md +0 -0
  138. data/tracks/coldfusion/exercises/pangram/Pangram.cfc +13 -0
  139. data/tracks/coldfusion/exercises/pangram/PangramTest.cfc +55 -0
  140. data/tracks/coldfusion/exercises/pangram/Solution.cfc +21 -0
  141. data/tracks/coldfusion/exercises/pangram/SolutionTest.cfc +7 -0
  142. data/tracks/coldfusion/exercises/pangram/TestRunner.cfc +103 -0
  143. data/tracks/coldfusion/exercises/pangram/box.json +8 -0
  144. data/tracks/coldfusion/exercises/pangram/index.cfm +37 -0
  145. data/tracks/coldfusion/exercises/pig-latin/.meta/HINTS.md +0 -0
  146. data/tracks/coldfusion/exercises/pig-latin/PigLatin.cfc +13 -0
  147. data/tracks/coldfusion/exercises/pig-latin/PigLatinTest.cfc +115 -0
  148. data/tracks/coldfusion/exercises/pig-latin/Solution.cfc +30 -0
  149. data/tracks/coldfusion/exercises/pig-latin/SolutionTest.cfc +7 -0
  150. data/tracks/coldfusion/exercises/pig-latin/TestRunner.cfc +103 -0
  151. data/tracks/coldfusion/exercises/pig-latin/box.json +8 -0
  152. data/tracks/coldfusion/exercises/pig-latin/index.cfm +37 -0
  153. data/tracks/coldfusion/exercises/raindrops/.meta/HINTS.md +0 -0
  154. data/tracks/coldfusion/exercises/raindrops/Raindrops.cfc +13 -0
  155. data/tracks/coldfusion/exercises/raindrops/RaindropsTest.cfc +87 -0
  156. data/tracks/coldfusion/exercises/raindrops/Solution.cfc +33 -0
  157. data/tracks/coldfusion/exercises/raindrops/SolutionTest.cfc +7 -0
  158. data/tracks/coldfusion/exercises/raindrops/TestRunner.cfc +103 -0
  159. data/tracks/coldfusion/exercises/raindrops/box.json +8 -0
  160. data/tracks/coldfusion/exercises/raindrops/index.cfm +37 -0
  161. data/tracks/coldfusion/exercises/rna-transcription/.meta/HINTS.md +0 -0
  162. data/tracks/coldfusion/exercises/rna-transcription/RnaTranscription.cfc +13 -0
  163. data/tracks/coldfusion/exercises/rna-transcription/RnaTranscriptionTest.cfc +47 -0
  164. data/tracks/coldfusion/exercises/rna-transcription/Solution.cfc +35 -0
  165. data/tracks/coldfusion/exercises/rna-transcription/SolutionTest.cfc +7 -0
  166. data/tracks/coldfusion/exercises/rna-transcription/TestRunner.cfc +103 -0
  167. data/tracks/coldfusion/exercises/rna-transcription/box.json +8 -0
  168. data/tracks/coldfusion/exercises/rna-transcription/index.cfm +37 -0
  169. data/tracks/coldfusion/exercises/saddle-points/.meta/HINTS.md +0 -0
  170. data/tracks/coldfusion/exercises/saddle-points/SaddlePoints.cfc +13 -0
  171. data/tracks/coldfusion/exercises/saddle-points/SaddlePointsTest.cfc +35 -0
  172. data/tracks/coldfusion/exercises/saddle-points/Solution.cfc +59 -0
  173. data/tracks/coldfusion/exercises/saddle-points/SolutionTest.cfc +7 -0
  174. data/tracks/coldfusion/exercises/saddle-points/TestRunner.cfc +103 -0
  175. data/tracks/coldfusion/exercises/saddle-points/box.json +8 -0
  176. data/tracks/coldfusion/exercises/saddle-points/index.cfm +37 -0
  177. data/tracks/coldfusion/exercises/scrabble-score/.meta/HINTS.md +0 -0
  178. data/tracks/coldfusion/exercises/scrabble-score/ScrabbleScore.cfc +13 -0
  179. data/tracks/coldfusion/exercises/scrabble-score/ScrabbleScoreTest.cfc +59 -0
  180. data/tracks/coldfusion/exercises/scrabble-score/Solution.cfc +50 -0
  181. data/tracks/coldfusion/exercises/scrabble-score/SolutionTest.cfc +7 -0
  182. data/tracks/coldfusion/exercises/scrabble-score/TestRunner.cfc +103 -0
  183. data/tracks/coldfusion/exercises/scrabble-score/box.json +8 -0
  184. data/tracks/coldfusion/exercises/scrabble-score/index.cfm +37 -0
  185. data/tracks/coldfusion/exercises/secret-handshake/.meta/HINTS.md +0 -0
  186. data/tracks/coldfusion/exercises/secret-handshake/SecretHandshake.cfc +13 -0
  187. data/tracks/coldfusion/exercises/secret-handshake/SecretHandshakeTest.cfc +63 -0
  188. data/tracks/coldfusion/exercises/secret-handshake/Solution.cfc +31 -0
  189. data/tracks/coldfusion/exercises/secret-handshake/SolutionTest.cfc +7 -0
  190. data/tracks/coldfusion/exercises/secret-handshake/TestRunner.cfc +103 -0
  191. data/tracks/coldfusion/exercises/secret-handshake/box.json +8 -0
  192. data/tracks/coldfusion/exercises/secret-handshake/index.cfm +37 -0
  193. data/tracks/coldfusion/exercises/space-age/.meta/HINTS.md +0 -0
  194. data/tracks/coldfusion/exercises/space-age/Solution.cfc +28 -0
  195. data/tracks/coldfusion/exercises/space-age/SolutionTest.cfc +7 -0
  196. data/tracks/coldfusion/exercises/space-age/SpaceAge.cfc +13 -0
  197. data/tracks/coldfusion/exercises/space-age/SpaceAgeTest.cfc +47 -0
  198. data/tracks/coldfusion/exercises/space-age/TestRunner.cfc +103 -0
  199. data/tracks/coldfusion/exercises/space-age/box.json +8 -0
  200. data/tracks/coldfusion/exercises/space-age/index.cfm +37 -0
  201. data/tracks/coldfusion/exercises/sum-of-multiples/.meta/HINTS.md +0 -0
  202. data/tracks/coldfusion/exercises/sum-of-multiples/Solution.cfc +27 -0
  203. data/tracks/coldfusion/exercises/sum-of-multiples/SolutionTest.cfc +7 -0
  204. data/tracks/coldfusion/exercises/sum-of-multiples/SumOfMultiples.cfc +13 -0
  205. data/tracks/coldfusion/exercises/sum-of-multiples/SumOfMultiplesTest.cfc +63 -0
  206. data/tracks/coldfusion/exercises/sum-of-multiples/TestRunner.cfc +103 -0
  207. data/tracks/coldfusion/exercises/sum-of-multiples/box.json +8 -0
  208. data/tracks/coldfusion/exercises/sum-of-multiples/index.cfm +37 -0
  209. data/tracks/coldfusion/exercises/triangle/.meta/HINTS.md +0 -0
  210. data/tracks/coldfusion/exercises/triangle/Solution.cfc +53 -0
  211. data/tracks/coldfusion/exercises/triangle/SolutionTest.cfc +7 -0
  212. data/tracks/coldfusion/exercises/triangle/TestRunner.cfc +103 -0
  213. data/tracks/coldfusion/exercises/triangle/Triangle.cfc +18 -0
  214. data/tracks/coldfusion/exercises/triangle/TriangleTest.cfc +95 -0
  215. data/tracks/coldfusion/exercises/triangle/box.json +8 -0
  216. data/tracks/coldfusion/exercises/triangle/index.cfm +37 -0
  217. data/tracks/coldfusion/tasks/GenerateTests.cfc +179 -0
  218. data/tracks/coldfusion/tasks/ScaffoldExercise.cfc +85 -0
  219. data/tracks/coldfusion/tasks/TestAllSolutions.cfc +24 -0
  220. data/tracks/coldfusion/tasks/exercise_template/.meta/HINTS.md +0 -0
  221. data/tracks/coldfusion/tasks/exercise_template/@@name@@.cfc +13 -0
  222. data/tracks/coldfusion/tasks/exercise_template/@@name@@Test.cfc +15 -0
  223. data/tracks/coldfusion/tasks/exercise_template/Solution.cfc +6 -0
  224. data/tracks/coldfusion/tasks/exercise_template/SolutionTest.cfc +7 -0
  225. data/tracks/coldfusion/tasks/exercise_template/TestRunner.cfc +103 -0
  226. data/tracks/coldfusion/tasks/exercise_template/box.json +8 -0
  227. data/tracks/coldfusion/tasks/exercise_template/index.cfm +37 -0
  228. data/tracks/common-lisp/config.json +12 -0
  229. data/tracks/common-lisp/exercises/collatz-conjecture/README.md +84 -0
  230. data/tracks/common-lisp/exercises/collatz-conjecture/collatz-conjecture-test.lisp +31 -0
  231. data/tracks/common-lisp/exercises/collatz-conjecture/collatz-conjecture.lisp +7 -0
  232. data/tracks/common-lisp/exercises/collatz-conjecture/example.lisp +14 -0
  233. data/tracks/csharp/exercises/clock/Clock.cs +20 -4
  234. data/tracks/csharp/exercises/clock/ClockTest.cs +290 -55
  235. data/tracks/csharp/exercises/clock/Example.cs +11 -8
  236. data/tracks/csharp/generators/Exercises/Clock.cs +75 -0
  237. data/tracks/csharp/generators/Output/FormattingExtensions.cs +0 -1
  238. data/tracks/csharp/generators/Program.cs +2 -1
  239. data/tracks/haskell/config.json +10 -0
  240. data/tracks/haskell/exercises/collatz-conjecture/README.md +87 -0
  241. data/tracks/haskell/exercises/collatz-conjecture/examples/success-standard/package.yaml +16 -0
  242. data/tracks/haskell/exercises/collatz-conjecture/examples/success-standard/src/CollatzConjecture.hs +9 -0
  243. data/tracks/haskell/exercises/collatz-conjecture/package.yaml +20 -0
  244. data/tracks/haskell/exercises/collatz-conjecture/src/CollatzConjecture.hs +4 -0
  245. data/tracks/haskell/exercises/collatz-conjecture/stack.yaml +1 -0
  246. data/tracks/haskell/exercises/collatz-conjecture/test/Tests.hs +52 -0
  247. data/tracks/idris/docs/SNIPPET.txt +10 -0
  248. data/tracks/rust/README.md +83 -2
  249. data/tracks/rust/config.json +24 -0
  250. data/tracks/rust/exercises/perfect-numbers/.gitignore +7 -0
  251. data/tracks/rust/exercises/perfect-numbers/Cargo.toml +5 -0
  252. data/tracks/rust/exercises/perfect-numbers/README.md +56 -0
  253. data/tracks/rust/exercises/perfect-numbers/example.rs +20 -0
  254. data/tracks/rust/exercises/perfect-numbers/src/lib.rs +0 -0
  255. data/tracks/rust/exercises/perfect-numbers/tests/perfect-numbers.rs +33 -0
  256. data/tracks/rust/exercises/poker/.gitignore +7 -0
  257. data/tracks/rust/exercises/poker/.meta/hints.md +8 -0
  258. data/tracks/rust/exercises/poker/Cargo-example.toml +8 -0
  259. data/tracks/rust/exercises/poker/Cargo.toml +6 -0
  260. data/tracks/rust/exercises/poker/README.md +54 -0
  261. data/tracks/rust/exercises/poker/example.rs +341 -0
  262. data/tracks/rust/exercises/poker/src/lib.rs +7 -0
  263. data/tracks/rust/exercises/poker/tests/poker.rs +298 -0
  264. metadata +242 -5
  265. data/tracks/coldfusion/exercises/leap/example.cfc +0 -11
  266. data/tracks/coldfusion/exercises/leap/leap.cfc +0 -5
  267. data/tracks/coldfusion/exercises/leap/leap_tests.cfc +0 -35
@@ -0,0 +1,7 @@
1
+ (defpackage #:collatz-conjecture
2
+ (:use #:common-lisp)
3
+ (:export #:collatz))
4
+
5
+ (in-package #:collatz-conjecture)
6
+
7
+ (defun collatz (n))
@@ -0,0 +1,14 @@
1
+ (defpackage #:collatz-conjecture
2
+ (:use #:common-lisp)
3
+ (:export #:collatz))
4
+
5
+ (in-package #:collatz-conjecture)
6
+
7
+ (defun collatz-helper (a n)
8
+ (cond ((= n 1) a)
9
+ ((evenp n) (collatz-helper (+ 1 a) (floor n 2)))
10
+ (T (collatz-helper (+ 1 a) (+ 1 (* 3 n))))))
11
+
12
+ (defun collatz (n)
13
+ (when (> n 0)
14
+ (collatz-helper 0 n)))
@@ -1,15 +1,26 @@
1
1
  using System;
2
2
 
3
- public class Clock
3
+ public struct Clock
4
4
  {
5
- public Clock(int hours)
5
+ public Clock(int hours, int minutes)
6
6
  {
7
7
  throw new NotImplementedException("You need to implement this function.");
8
8
  }
9
9
 
10
- public Clock(int hours, int minutes)
10
+ public int Hours
11
11
  {
12
- throw new NotImplementedException("You need to implement this function.");
12
+ get
13
+ {
14
+ throw new NotImplementedException("You need to implement this function.");
15
+ }
16
+ }
17
+
18
+ public int Minutes
19
+ {
20
+ get
21
+ {
22
+ throw new NotImplementedException("You need to implement this function.");
23
+ }
13
24
  }
14
25
 
15
26
  public Clock Add(int minutesToAdd)
@@ -21,4 +32,9 @@ public Clock Subtract(int minutesToSubtract)
21
32
  {
22
33
  throw new NotImplementedException("You need to implement this function.");
23
34
  }
35
+
36
+ public override string ToString()
37
+ {
38
+ throw new NotImplementedException("You need to implement this function.");
39
+ }
24
40
  }
@@ -1,121 +1,356 @@
1
+ // This file was auto-generated based on version 1.0.1 of the canonical data.
2
+
1
3
  using Xunit;
2
4
 
3
5
  public class ClockTest
4
6
  {
5
- [Theory]
6
- [InlineData(8, "08:00")]
7
- [InlineData(9, "09:00")]
8
- public void Prints_the_hour(int hours, string expected)
7
+ [Fact]
8
+ public void On_the_hour()
9
9
  {
10
- Assert.Equal(expected, new Clock(hours).ToString());
10
+ var sut = new Clock(8, 0);
11
+ Assert.Equal("08:00", sut.ToString());
11
12
  }
12
13
 
13
- [Theory(Skip = "Remove to run test")]
14
- [InlineData(11, 9, "11:09")]
15
- [InlineData(11, 19, "11:19")]
16
- public void Prints_past_the_hour(int hours, int minutes, string expected)
14
+ [Fact(Skip = "Remove to run test")]
15
+ public void Past_the_hour()
17
16
  {
18
- Assert.Equal(expected, new Clock(hours, minutes).ToString());
17
+ var sut = new Clock(11, 9);
18
+ Assert.Equal("11:09", sut.ToString());
19
19
  }
20
20
 
21
21
  [Fact(Skip = "Remove to run test")]
22
- public void Can_add_minutes()
22
+ public void Midnight_is_zero_hours()
23
23
  {
24
- var clock = new Clock(10).Add(3);
25
- Assert.Equal("10:03", clock.ToString());
24
+ var sut = new Clock(24, 0);
25
+ Assert.Equal("00:00", sut.ToString());
26
26
  }
27
27
 
28
28
  [Fact(Skip = "Remove to run test")]
29
- public void Can_add_over_an_hour()
29
+ public void Hour_rolls_over()
30
30
  {
31
- var clock = new Clock(10).Add(63);
32
- Assert.Equal("11:03", clock.ToString());
31
+ var sut = new Clock(25, 0);
32
+ Assert.Equal("01:00", sut.ToString());
33
33
  }
34
34
 
35
35
  [Fact(Skip = "Remove to run test")]
36
- public void Can_add_over_more_than_one_day()
36
+ public void Hour_rolls_over_continuously()
37
37
  {
38
- var clock = new Clock(10).Add(7224);
39
- Assert.Equal("10:24", clock.ToString());
38
+ var sut = new Clock(100, 0);
39
+ Assert.Equal("04:00", sut.ToString());
40
40
  }
41
41
 
42
42
  [Fact(Skip = "Remove to run test")]
43
- public void Can_subtract_minutes()
43
+ public void Sixty_minutes_is_next_hour()
44
44
  {
45
- var clock = new Clock(10, 3).Subtract(3);
46
- Assert.Equal("10:00", clock.ToString());
45
+ var sut = new Clock(1, 60);
46
+ Assert.Equal("02:00", sut.ToString());
47
47
  }
48
48
 
49
49
  [Fact(Skip = "Remove to run test")]
50
- public void Can_subtract_to_previous_hour()
50
+ public void Minutes_roll_over()
51
51
  {
52
- var clock = new Clock(10, 3).Subtract(30);
53
- Assert.Equal("09:33", clock.ToString());
52
+ var sut = new Clock(0, 160);
53
+ Assert.Equal("02:40", sut.ToString());
54
54
  }
55
55
 
56
56
  [Fact(Skip = "Remove to run test")]
57
- public void Can_subtract_over_an_hour()
57
+ public void Minutes_roll_over_continuously()
58
58
  {
59
- var clock = new Clock(10, 3).Subtract(70);
60
- Assert.Equal("08:53", clock.ToString());
59
+ var sut = new Clock(0, 1723);
60
+ Assert.Equal("04:43", sut.ToString());
61
61
  }
62
62
 
63
63
  [Fact(Skip = "Remove to run test")]
64
- public void Wraps_around_midnight()
64
+ public void Hour_and_minutes_roll_over()
65
65
  {
66
- var clock = new Clock(23, 59).Add(2);
67
- Assert.Equal("00:01", clock.ToString());
66
+ var sut = new Clock(25, 160);
67
+ Assert.Equal("03:40", sut.ToString());
68
68
  }
69
69
 
70
70
  [Fact(Skip = "Remove to run test")]
71
- public void Wraps_around_midnight_backwards()
71
+ public void Hour_and_minutes_roll_over_continuously()
72
72
  {
73
- var clock = new Clock(0, 1).Subtract(2);
74
- Assert.Equal("23:59", clock.ToString());
73
+ var sut = new Clock(201, 3001);
74
+ Assert.Equal("11:01", sut.ToString());
75
75
  }
76
76
 
77
77
  [Fact(Skip = "Remove to run test")]
78
- public void Midnight_is_zero_hundred_hours()
78
+ public void Hour_and_minutes_roll_over_to_exactly_midnight()
79
79
  {
80
- var clock = new Clock(24);
81
- Assert.Equal("00:00", clock.ToString());
80
+ var sut = new Clock(72, 8640);
81
+ Assert.Equal("00:00", sut.ToString());
82
82
  }
83
83
 
84
84
  [Fact(Skip = "Remove to run test")]
85
- public void Sixty_minutes_is_next_hour()
85
+ public void Negative_hour()
86
+ {
87
+ var sut = new Clock(-1, 15);
88
+ Assert.Equal("23:15", sut.ToString());
89
+ }
90
+
91
+ [Fact(Skip = "Remove to run test")]
92
+ public void Negative_hour_rolls_over()
93
+ {
94
+ var sut = new Clock(-25, 0);
95
+ Assert.Equal("23:00", sut.ToString());
96
+ }
97
+
98
+ [Fact(Skip = "Remove to run test")]
99
+ public void Negative_hour_rolls_over_continuously()
100
+ {
101
+ var sut = new Clock(-91, 0);
102
+ Assert.Equal("05:00", sut.ToString());
103
+ }
104
+
105
+ [Fact(Skip = "Remove to run test")]
106
+ public void Negative_minutes()
107
+ {
108
+ var sut = new Clock(1, -40);
109
+ Assert.Equal("00:20", sut.ToString());
110
+ }
111
+
112
+ [Fact(Skip = "Remove to run test")]
113
+ public void Negative_minutes_roll_over()
114
+ {
115
+ var sut = new Clock(1, -160);
116
+ Assert.Equal("22:20", sut.ToString());
117
+ }
118
+
119
+ [Fact(Skip = "Remove to run test")]
120
+ public void Negative_minutes_roll_over_continuously()
121
+ {
122
+ var sut = new Clock(1, -4820);
123
+ Assert.Equal("16:40", sut.ToString());
124
+ }
125
+
126
+ [Fact(Skip = "Remove to run test")]
127
+ public void Negative_hour_and_minutes_both_roll_over()
128
+ {
129
+ var sut = new Clock(-25, -160);
130
+ Assert.Equal("20:20", sut.ToString());
131
+ }
132
+
133
+ [Fact(Skip = "Remove to run test")]
134
+ public void Negative_hour_and_minutes_both_roll_over_continuously()
135
+ {
136
+ var sut = new Clock(-121, -5810);
137
+ Assert.Equal("22:10", sut.ToString());
138
+ }
139
+
140
+ [Fact(Skip = "Remove to run test")]
141
+ public void Add_minutes()
142
+ {
143
+ var sut = new Clock(10, 0);
144
+ Assert.Equal("10:03", sut.Add(3).ToString());
145
+ }
146
+
147
+ [Fact(Skip = "Remove to run test")]
148
+ public void Add_no_minutes()
149
+ {
150
+ var sut = new Clock(6, 41);
151
+ Assert.Equal("06:41", sut.Add(0).ToString());
152
+ }
153
+
154
+ [Fact(Skip = "Remove to run test")]
155
+ public void Add_to_next_hour()
156
+ {
157
+ var sut = new Clock(0, 45);
158
+ Assert.Equal("01:25", sut.Add(40).ToString());
159
+ }
160
+
161
+ [Fact(Skip = "Remove to run test")]
162
+ public void Add_more_than_one_hour()
163
+ {
164
+ var sut = new Clock(10, 0);
165
+ Assert.Equal("11:01", sut.Add(61).ToString());
166
+ }
167
+
168
+ [Fact(Skip = "Remove to run test")]
169
+ public void Add_more_than_two_hours_with_carry()
170
+ {
171
+ var sut = new Clock(0, 45);
172
+ Assert.Equal("03:25", sut.Add(160).ToString());
173
+ }
174
+
175
+ [Fact(Skip = "Remove to run test")]
176
+ public void Add_across_midnight()
177
+ {
178
+ var sut = new Clock(23, 59);
179
+ Assert.Equal("00:01", sut.Add(2).ToString());
180
+ }
181
+
182
+ [Fact(Skip = "Remove to run test")]
183
+ public void Add_more_than_one_day_1500_min_25_hrs_()
184
+ {
185
+ var sut = new Clock(5, 32);
186
+ Assert.Equal("06:32", sut.Add(1500).ToString());
187
+ }
188
+
189
+ [Fact(Skip = "Remove to run test")]
190
+ public void Add_more_than_two_days()
191
+ {
192
+ var sut = new Clock(1, 1);
193
+ Assert.Equal("11:21", sut.Add(3500).ToString());
194
+ }
195
+
196
+ [Fact(Skip = "Remove to run test")]
197
+ public void Subtract_minutes()
198
+ {
199
+ var sut = new Clock(10, 3);
200
+ Assert.Equal("10:00", sut.Add(-3).ToString());
201
+ }
202
+
203
+ [Fact(Skip = "Remove to run test")]
204
+ public void Subtract_to_previous_hour()
205
+ {
206
+ var sut = new Clock(10, 3);
207
+ Assert.Equal("09:33", sut.Add(-30).ToString());
208
+ }
209
+
210
+ [Fact(Skip = "Remove to run test")]
211
+ public void Subtract_more_than_an_hour()
212
+ {
213
+ var sut = new Clock(10, 3);
214
+ Assert.Equal("08:53", sut.Add(-70).ToString());
215
+ }
216
+
217
+ [Fact(Skip = "Remove to run test")]
218
+ public void Subtract_across_midnight()
219
+ {
220
+ var sut = new Clock(0, 3);
221
+ Assert.Equal("23:59", sut.Add(-4).ToString());
222
+ }
223
+
224
+ [Fact(Skip = "Remove to run test")]
225
+ public void Subtract_more_than_two_hours()
226
+ {
227
+ var sut = new Clock(0, 0);
228
+ Assert.Equal("21:20", sut.Add(-160).ToString());
229
+ }
230
+
231
+ [Fact(Skip = "Remove to run test")]
232
+ public void Subtract_more_than_two_hours_with_borrow()
233
+ {
234
+ var sut = new Clock(6, 15);
235
+ Assert.Equal("03:35", sut.Add(-160).ToString());
236
+ }
237
+
238
+ [Fact(Skip = "Remove to run test")]
239
+ public void Subtract_more_than_one_day_1500_min_25_hrs_()
240
+ {
241
+ var sut = new Clock(5, 32);
242
+ Assert.Equal("04:32", sut.Add(-1500).ToString());
243
+ }
244
+
245
+ [Fact(Skip = "Remove to run test")]
246
+ public void Subtract_more_than_two_days()
247
+ {
248
+ var sut = new Clock(2, 20);
249
+ Assert.Equal("00:20", sut.Add(-3000).ToString());
250
+ }
251
+
252
+ [Fact(Skip = "Remove to run test")]
253
+ public void Clocks_with_same_time()
254
+ {
255
+ var sut = new Clock(15, 37);
256
+ Assert.True(sut.Equals(new Clock(15, 37)));
257
+ }
258
+
259
+ [Fact(Skip = "Remove to run test")]
260
+ public void Clocks_a_minute_apart()
261
+ {
262
+ var sut = new Clock(15, 36);
263
+ Assert.False(sut.Equals(new Clock(15, 37)));
264
+ }
265
+
266
+ [Fact(Skip = "Remove to run test")]
267
+ public void Clocks_an_hour_apart()
268
+ {
269
+ var sut = new Clock(14, 37);
270
+ Assert.False(sut.Equals(new Clock(15, 37)));
271
+ }
272
+
273
+ [Fact(Skip = "Remove to run test")]
274
+ public void Clocks_with_hour_overflow()
275
+ {
276
+ var sut = new Clock(10, 37);
277
+ Assert.True(sut.Equals(new Clock(34, 37)));
278
+ }
279
+
280
+ [Fact(Skip = "Remove to run test")]
281
+ public void Clocks_with_hour_overflow_by_several_days()
282
+ {
283
+ var sut = new Clock(3, 11);
284
+ Assert.True(sut.Equals(new Clock(99, 11)));
285
+ }
286
+
287
+ [Fact(Skip = "Remove to run test")]
288
+ public void Clocks_with_negative_hour()
289
+ {
290
+ var sut = new Clock(22, 40);
291
+ Assert.True(sut.Equals(new Clock(-2, 40)));
292
+ }
293
+
294
+ [Fact(Skip = "Remove to run test")]
295
+ public void Clocks_with_negative_hour_that_wraps()
296
+ {
297
+ var sut = new Clock(17, 3);
298
+ Assert.True(sut.Equals(new Clock(-31, 3)));
299
+ }
300
+
301
+ [Fact(Skip = "Remove to run test")]
302
+ public void Clocks_with_negative_hour_that_wraps_multiple_times()
303
+ {
304
+ var sut = new Clock(13, 49);
305
+ Assert.True(sut.Equals(new Clock(-83, 49)));
306
+ }
307
+
308
+ [Fact(Skip = "Remove to run test")]
309
+ public void Clocks_with_minute_overflow()
310
+ {
311
+ var sut = new Clock(0, 1);
312
+ Assert.True(sut.Equals(new Clock(0, 1441)));
313
+ }
314
+
315
+ [Fact(Skip = "Remove to run test")]
316
+ public void Clocks_with_minute_overflow_by_several_days()
317
+ {
318
+ var sut = new Clock(2, 2);
319
+ Assert.True(sut.Equals(new Clock(2, 4322)));
320
+ }
321
+
322
+ [Fact(Skip = "Remove to run test")]
323
+ public void Clocks_with_negative_minute()
86
324
  {
87
- var clock = new Clock(1, 60);
88
- Assert.Equal("02:00", clock.ToString());
325
+ var sut = new Clock(2, 40);
326
+ Assert.True(sut.Equals(new Clock(3, -20)));
89
327
  }
90
328
 
91
329
  [Fact(Skip = "Remove to run test")]
92
- public void Clocks_with_same_time_are_equal()
330
+ public void Clocks_with_negative_minute_that_wraps()
93
331
  {
94
- var clock1 = new Clock(14, 30);
95
- var clock2 = new Clock(14, 30);
96
- Assert.Equal(clock2, clock1);
332
+ var sut = new Clock(4, 10);
333
+ Assert.True(sut.Equals(new Clock(5, -1490)));
97
334
  }
98
335
 
99
336
  [Fact(Skip = "Remove to run test")]
100
- public void Clocks_with_different_time_are_not_equal()
337
+ public void Clocks_with_negative_minute_that_wraps_multiple_times()
101
338
  {
102
- var clock1 = new Clock(15, 30);
103
- var clock2 = new Clock(14, 30);
104
- Assert.NotEqual(clock2, clock1);
339
+ var sut = new Clock(6, 15);
340
+ Assert.True(sut.Equals(new Clock(6, -4305)));
105
341
  }
106
342
 
107
343
  [Fact(Skip = "Remove to run test")]
108
- public void Overflown_clocks_with_same_time_are_equal()
344
+ public void Clocks_with_negative_hours_and_minutes()
109
345
  {
110
- var clock1 = new Clock(14, 30);
111
- var clock2 = new Clock(38, 30);
112
- Assert.Equal(clock2, clock1);
346
+ var sut = new Clock(7, 32);
347
+ Assert.True(sut.Equals(new Clock(-12, -268)));
113
348
  }
114
349
 
115
350
  [Fact(Skip = "Remove to run test")]
116
- public void Can_wrap_around_more_than_one_day()
351
+ public void Clocks_with_negative_hours_and_minutes_that_wrap()
117
352
  {
118
- var clock = new Clock(10).Subtract(7224);
119
- Assert.Equal("09:36", clock.ToString());
353
+ var sut = new Clock(18, 7);
354
+ Assert.True(sut.Equals(new Clock(-54, -11513)));
120
355
  }
121
356
  }