trackler 2.2.1.10 → 2.2.1.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (240) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +3 -0
  3. data/lib/trackler/version.rb +1 -1
  4. data/problem-specifications/CONTRIBUTING.md +1 -1
  5. data/problem-specifications/TOPICS.txt +1 -0
  6. data/problem-specifications/exercises/accumulate/description.md +0 -3
  7. data/problem-specifications/exercises/hamming/canonical-data.json +3 -3
  8. data/problem-specifications/exercises/house/canonical-data.json +322 -0
  9. data/problem-specifications/exercises/palindrome-products/description.md +2 -2
  10. data/problem-specifications/exercises/simple-cipher/description.md +1 -1
  11. data/tracks/bash/config.json +0 -11
  12. data/tracks/cpp/docs/ABOUT.md +12 -37
  13. data/tracks/csharp/config.json +37 -0
  14. data/tracks/csharp/config/maintainers.json +10 -0
  15. data/tracks/csharp/docs/ABOUT.md +1 -1
  16. data/tracks/csharp/docs/RESOURCES.md +2 -2
  17. data/tracks/csharp/exercises/Exercises.All.sln +50 -8
  18. data/tracks/csharp/exercises/Exercises.Default.sln +50 -8
  19. data/tracks/csharp/exercises/collatz-conjecture/CollatzConjecture.cs +9 -0
  20. data/tracks/csharp/exercises/collatz-conjecture/CollatzConjecture.csproj +18 -0
  21. data/tracks/csharp/exercises/collatz-conjecture/CollatzConjectureTest.cs +43 -0
  22. data/tracks/csharp/exercises/collatz-conjecture/Example.cs +30 -0
  23. data/tracks/csharp/exercises/collatz-conjecture/README.md +38 -0
  24. data/tracks/csharp/exercises/diamond/Diamond.cs +1 -1
  25. data/tracks/csharp/exercises/diamond/Diamond.csproj +3 -1
  26. data/tracks/csharp/exercises/diamond/DiamondTest.cs +39 -21
  27. data/tracks/csharp/exercises/diamond/Example.cs +2 -2
  28. data/tracks/csharp/exercises/diamond/HINTS.md +3 -1
  29. data/tracks/csharp/exercises/spiral-matrix/Example.cs +40 -0
  30. data/tracks/csharp/exercises/spiral-matrix/README.md +36 -0
  31. data/tracks/csharp/exercises/spiral-matrix/SpiralMatrix.cs +9 -0
  32. data/tracks/csharp/exercises/spiral-matrix/SpiralMatrix.csproj +18 -0
  33. data/tracks/csharp/exercises/spiral-matrix/SpiralMatrixTest.cs +78 -0
  34. data/tracks/csharp/exercises/two-fer/Example.cs +16 -0
  35. data/tracks/csharp/exercises/two-fer/README.md +25 -0
  36. data/tracks/csharp/exercises/two-fer/TwoFer.cs +9 -0
  37. data/tracks/csharp/exercises/two-fer/TwoFer.csproj +18 -0
  38. data/tracks/csharp/exercises/two-fer/TwoFerTest.cs +24 -0
  39. data/tracks/dart/README.md +1 -1
  40. data/tracks/dart/docs/EXERCISE_README_INSERT.md +9 -0
  41. data/tracks/dart/docs/INSTALLATION.md +13 -0
  42. data/tracks/dart/docs/LEARNING.md +6 -0
  43. data/tracks/dart/docs/RESOURCES.md +7 -0
  44. data/tracks/dart/docs/TESTS.md +133 -0
  45. data/tracks/delphi/docs/ABOUT.md +18 -5
  46. data/tracks/delphi/docs/Getting_Started_Guide.md +930 -0
  47. data/tracks/delphi/exercises/hamming/uHammingExample.pas +1 -1
  48. data/tracks/delphi/exercises/hamming/uHammingTests.pas +15 -15
  49. data/tracks/ecmascript/.travis.yml +2 -1
  50. data/tracks/ecmascript/Makefile +19 -8
  51. data/tracks/ecmascript/config.json +16 -0
  52. data/tracks/ecmascript/exercises/accumulate/package.json +5 -5
  53. data/tracks/ecmascript/exercises/acronym/package.json +5 -5
  54. data/tracks/ecmascript/exercises/all-your-base/package.json +5 -5
  55. data/tracks/ecmascript/exercises/allergies/package.json +5 -5
  56. data/tracks/ecmascript/exercises/alphametics/package.json +5 -5
  57. data/tracks/ecmascript/exercises/anagram/package.json +5 -5
  58. data/tracks/ecmascript/exercises/atbash-cipher/package.json +5 -5
  59. data/tracks/ecmascript/exercises/beer-song/package.json +5 -5
  60. data/tracks/ecmascript/exercises/binary-search-tree/package.json +5 -5
  61. data/tracks/ecmascript/exercises/binary-search/package.json +5 -5
  62. data/tracks/ecmascript/exercises/binary/package.json +5 -5
  63. data/tracks/ecmascript/exercises/bob/package.json +5 -5
  64. data/tracks/ecmascript/exercises/bracket-push/package.json +5 -5
  65. data/tracks/ecmascript/exercises/circular-buffer/package.json +5 -5
  66. data/tracks/ecmascript/exercises/clock/package.json +5 -5
  67. data/tracks/ecmascript/exercises/connect/package.json +5 -5
  68. data/tracks/ecmascript/exercises/crypto-square/package.json +5 -5
  69. data/tracks/ecmascript/exercises/custom-set/package.json +5 -5
  70. data/tracks/ecmascript/exercises/diamond/package.json +5 -5
  71. data/tracks/ecmascript/exercises/difference-of-squares/package.json +5 -5
  72. data/tracks/ecmascript/exercises/diffie-hellman/package.json +5 -5
  73. data/tracks/ecmascript/exercises/etl/package.json +5 -5
  74. data/tracks/ecmascript/exercises/flatten-array/package.json +5 -5
  75. data/tracks/ecmascript/exercises/food-chain/package.json +5 -5
  76. data/tracks/ecmascript/exercises/gigasecond/package.json +5 -5
  77. data/tracks/ecmascript/exercises/grade-school/package.json +5 -5
  78. data/tracks/ecmascript/exercises/grains/package.json +5 -5
  79. data/tracks/ecmascript/exercises/hamming/package.json +5 -5
  80. data/tracks/ecmascript/exercises/hello-world/package.json +5 -5
  81. data/tracks/ecmascript/exercises/hexadecimal/package.json +5 -5
  82. data/tracks/ecmascript/exercises/isogram/package.json +5 -5
  83. data/tracks/ecmascript/exercises/kindergarten-garden/package.json +5 -5
  84. data/tracks/ecmascript/exercises/largest-series-product/package.json +5 -5
  85. data/tracks/ecmascript/exercises/leap/package.json +5 -5
  86. data/tracks/ecmascript/exercises/linked-list/package.json +5 -5
  87. data/tracks/ecmascript/exercises/list-ops/package.json +5 -5
  88. data/tracks/ecmascript/exercises/luhn/package.json +5 -5
  89. data/tracks/ecmascript/exercises/matrix/package.json +5 -5
  90. data/tracks/ecmascript/exercises/meetup/package.json +5 -5
  91. data/tracks/ecmascript/exercises/minesweeper/package.json +5 -5
  92. data/tracks/ecmascript/exercises/nth-prime/package.json +5 -5
  93. data/tracks/ecmascript/exercises/ocr-numbers/package.json +5 -5
  94. data/tracks/ecmascript/exercises/octal/package.json +5 -5
  95. data/tracks/ecmascript/exercises/palindrome-products/package.json +5 -5
  96. data/tracks/ecmascript/exercises/pangram/package.json +5 -5
  97. data/tracks/ecmascript/exercises/pascals-triangle/package.json +5 -5
  98. data/tracks/ecmascript/exercises/perfect-numbers/package.json +5 -5
  99. data/tracks/ecmascript/exercises/phone-number/package.json +5 -5
  100. data/tracks/ecmascript/exercises/pig-latin/package.json +5 -5
  101. data/tracks/ecmascript/exercises/prime-factors/package.json +5 -5
  102. data/tracks/ecmascript/exercises/pythagorean-triplet/package.json +5 -5
  103. data/tracks/ecmascript/exercises/queen-attack/package.json +5 -5
  104. data/tracks/ecmascript/exercises/raindrops/package.json +5 -5
  105. data/tracks/ecmascript/exercises/rna-transcription/package.json +5 -5
  106. data/tracks/ecmascript/exercises/robot-name/package.json +5 -5
  107. data/tracks/ecmascript/exercises/robot-simulator/package.json +5 -5
  108. data/tracks/ecmascript/exercises/roman-numerals/package.json +5 -5
  109. data/tracks/ecmascript/exercises/run-length-encoding/README.md +59 -0
  110. data/tracks/ecmascript/exercises/run-length-encoding/example.js +13 -0
  111. data/tracks/ecmascript/exercises/run-length-encoding/package.json +69 -0
  112. data/tracks/ecmascript/exercises/run-length-encoding/run-length-encoding.spec.js +59 -0
  113. data/tracks/ecmascript/exercises/saddle-points/package.json +5 -5
  114. data/tracks/ecmascript/exercises/say/package.json +5 -5
  115. data/tracks/ecmascript/exercises/scrabble-score/package.json +5 -5
  116. data/tracks/ecmascript/exercises/secret-handshake/package.json +5 -5
  117. data/tracks/ecmascript/exercises/series/package.json +5 -5
  118. data/tracks/ecmascript/exercises/sieve/package.json +5 -5
  119. data/tracks/ecmascript/exercises/simple-cipher/package.json +5 -5
  120. data/tracks/ecmascript/exercises/space-age/package.json +5 -5
  121. data/tracks/ecmascript/exercises/strain/package.json +5 -5
  122. data/tracks/ecmascript/exercises/sublist/package.json +5 -5
  123. data/tracks/ecmascript/exercises/sum-of-multiples/package.json +5 -5
  124. data/tracks/ecmascript/exercises/triangle/package.json +5 -5
  125. data/tracks/ecmascript/exercises/trinary/package.json +5 -5
  126. data/tracks/ecmascript/exercises/twelve-days/package.json +6 -5
  127. data/tracks/ecmascript/exercises/two-bucket/package.json +5 -5
  128. data/tracks/ecmascript/exercises/word-count/package.json +5 -5
  129. data/tracks/ecmascript/exercises/wordy/package.json +5 -5
  130. data/tracks/ecmascript/package.json +5 -5
  131. data/tracks/ecmascript/yarn.lock +403 -152
  132. data/tracks/elixir/docs/ABOUT.md +7 -20
  133. data/tracks/erlang/docs/ABOUT.md +4 -6
  134. data/tracks/fsharp/config.json +2 -1
  135. data/tracks/fsharp/docs/ABOUT.md +6 -2
  136. data/tracks/gnu-apl/.gitignore +4 -0
  137. data/tracks/gnu-apl/.travis.yml +5 -0
  138. data/tracks/gnu-apl/LICENSE +21 -0
  139. data/tracks/gnu-apl/README.md +67 -0
  140. data/tracks/gnu-apl/bin/fetch-configlet +32 -0
  141. data/tracks/gnu-apl/config.json +15 -0
  142. data/tracks/{scala/exercises/binary-search/src/main/scala/BinarySearch.scala → gnu-apl/config/exercise-readme-insert.md} +0 -0
  143. data/tracks/gnu-apl/config/exercise-readme.go.tmpl +16 -0
  144. data/tracks/gnu-apl/config/maintainers.json +6 -0
  145. data/tracks/gnu-apl/docs/ABOUT.md +0 -0
  146. data/tracks/gnu-apl/docs/INSTALLATION.md +0 -0
  147. data/tracks/gnu-apl/docs/LEARNING.md +0 -0
  148. data/tracks/gnu-apl/docs/RESOURCES.md +0 -0
  149. data/tracks/gnu-apl/docs/TESTS.md +0 -0
  150. data/tracks/gnu-apl/img/.keep +0 -0
  151. data/tracks/go/docs/ABOUT.md +4 -2
  152. data/tracks/go/exercises/pangram/example.go +1 -1
  153. data/tracks/go/exercises/pangram/pangram.go +1 -1
  154. data/tracks/go/exercises/pangram/pangram_test.go +1 -3
  155. data/tracks/groovy/README.md +2 -0
  156. data/tracks/groovy/config.json +25 -20
  157. data/tracks/groovy/docs/ABOUT.md +10 -3
  158. data/tracks/groovy/exercises/difference-of-squares/DifferenceOfSquares.groovy +19 -0
  159. data/tracks/groovy/exercises/difference-of-squares/{SquaresSpec.groovy → DifferenceOfSquaresSpec.groovy} +3 -3
  160. data/tracks/groovy/exercises/difference-of-squares/Example.groovy +1 -1
  161. data/tracks/groovy/exercises/hamming/Hamming.groovy +7 -0
  162. data/tracks/groovy/exercises/leap/Example.groovy +2 -2
  163. data/tracks/groovy/exercises/leap/Leap.groovy +11 -0
  164. data/tracks/groovy/exercises/leap/LeapSpec.groovy +4 -4
  165. data/tracks/groovy/exercises/nth-prime/Example.groovy +1 -1
  166. data/tracks/groovy/exercises/nth-prime/NthPrime.groovy +7 -0
  167. data/tracks/groovy/exercises/nth-prime/{PrimeSpec.groovy → NthPrimeSpec.groovy} +6 -6
  168. data/tracks/groovy/exercises/phone-number/PhoneNumber.groovy +17 -0
  169. data/tracks/groovy/exercises/raindrops/Raindrops.groovy +7 -0
  170. data/tracks/groovy/exercises/rna-transcription/Example.groovy +1 -1
  171. data/tracks/groovy/exercises/rna-transcription/RnaTranscription.groovy +7 -0
  172. data/tracks/groovy/exercises/rna-transcription/{ComplementSpec.groovy → RnaTranscriptionSpec.groovy} +2 -2
  173. data/tracks/groovy/exercises/robot-name/Example.groovy +2 -2
  174. data/tracks/groovy/exercises/robot-name/RobotName.groovy +9 -0
  175. data/tracks/groovy/exercises/robot-name/{RobotSpec.groovy → RobotNameSpec.groovy} +6 -6
  176. data/tracks/groovy/exercises/roman-numerals/Example.groovy +2 -2
  177. data/tracks/groovy/exercises/roman-numerals/RomanNumerals.groovy +7 -0
  178. data/tracks/groovy/exercises/roman-numerals/{RomanSpec.groovy → RomanNumeralsSpec.groovy} +2 -2
  179. data/tracks/groovy/exercises/word-count/Example.groovy +2 -2
  180. data/tracks/groovy/exercises/word-count/{Phrase.groovy → WordCount.groovy} +2 -2
  181. data/tracks/groovy/exercises/word-count/WordCountSpec.groovy +47 -0
  182. data/tracks/java/config.json +84 -74
  183. data/tracks/java/docs/ABOUT.md +11 -5
  184. data/tracks/java/exercises/house/README.md +124 -0
  185. data/tracks/java/exercises/house/build.gradle +18 -0
  186. data/tracks/java/exercises/house/src/example/java/House.java +55 -0
  187. data/tracks/java/exercises/house/src/main/java/.keep +0 -0
  188. data/tracks/java/exercises/house/src/test/java/HouseTest.java +341 -0
  189. data/tracks/java/exercises/minesweeper/src/example/java/MinesweeperBoard.java +3 -3
  190. data/tracks/java/exercises/series/src/test/java/SeriesTest.java +6 -5
  191. data/tracks/java/exercises/settings.gradle +1 -0
  192. data/tracks/java/exercises/two-fer/src/test/java/TwoferTest.java +9 -0
  193. data/tracks/javascript/exercises/circular-buffer/circular-buffer.spec.js +8 -0
  194. data/tracks/javascript/exercises/simple-cipher/README.md +1 -1
  195. data/tracks/kotlin/docs/ABOUT.md +7 -10
  196. data/tracks/lisp/.travis.yml +26 -11
  197. data/tracks/purescript/docs/ABOUT.md +16 -0
  198. data/tracks/r/config.json +1 -1
  199. data/tracks/r/config/maintainers.json +9 -9
  200. data/tracks/r/docs/ABOUT.md +9 -11
  201. data/tracks/r/docs/snippet.txt +10 -0
  202. data/tracks/ruby/docs/ABOUT.md +5 -5
  203. data/tracks/ruby/exercises/collatz-conjecture/.meta/generator/collatz_conjecture_case.rb +1 -2
  204. data/tracks/ruby/exercises/space-age/.meta/generator/space_age_case.rb +1 -2
  205. data/tracks/ruby/exercises/sum-of-multiples/.meta/generator/sum_of_multiples_case.rb +1 -1
  206. data/tracks/ruby/lib/generator/exercise_case.rb +15 -0
  207. data/tracks/scala/exercises/alphametics/src/test/scala/AlphameticsTest.scala +42 -28
  208. data/tracks/scala/exercises/binary-search/example.scala +1 -1
  209. data/tracks/scala/exercises/binary-search/src/main/scala/.keep +0 -0
  210. data/tracks/scala/exercises/binary-search/src/test/scala/BinarySearchTest.scala +13 -22
  211. data/tracks/scala/exercises/bowling/src/main/scala/.keep +0 -0
  212. data/tracks/scala/exercises/bowling/src/test/scala/BowlingSuite.scala +30 -17
  213. data/tracks/scala/exercises/change/src/test/scala/ChangeTest.scala +14 -4
  214. data/tracks/scala/exercises/custom-set/src/test/scala/CustomSetTest.scala +6 -4
  215. data/tracks/scala/exercises/food-chain/example.scala +4 -2
  216. data/tracks/scala/exercises/food-chain/src/test/scala/FoodChainTest.scala +170 -59
  217. data/tracks/scala/exercises/luhn/example.scala +9 -21
  218. data/tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala +46 -10
  219. data/tracks/scala/testgen/src/main/scala/AlphametricsTestGenerator.scala +42 -0
  220. data/tracks/scala/testgen/src/main/scala/BinarySearchTestGenerator.scala +32 -42
  221. data/tracks/scala/testgen/src/main/scala/BowlingTestGenerator.scala +22 -7
  222. data/tracks/scala/testgen/src/main/scala/ChangeTestGenerator.scala +37 -0
  223. data/tracks/scala/testgen/src/main/scala/CustomSetTestGenerator.scala +25 -20
  224. data/tracks/scala/testgen/src/main/scala/FoodChainTestGenerator.scala +13 -2
  225. data/tracks/scala/testgen/src/main/scala/LuhnTestGenerator.scala +15 -0
  226. data/tracks/scala/testgen/src/main/scala/TestBuilder.scala +10 -0
  227. data/tracks/sml/.travis.yml +9 -2
  228. data/tracks/sml/Makefile +42 -0
  229. data/tracks/sml/docs/EXERCISE_README_INSERT.md +21 -5
  230. data/tracks/sml/docs/RESOURCES.md +1 -1
  231. data/tracks/sml/docs/TESTS.md +2 -2
  232. metadata +67 -17
  233. data/tracks/bash/exercises/word-count/README.md +0 -24
  234. data/tracks/bash/exercises/word-count/example.awk +0 -12
  235. data/tracks/bash/exercises/word-count/example.sh +0 -21
  236. data/tracks/dart/.github/PULL_REQUEST_TEMPLATE.md +0 -23
  237. data/tracks/ecmascript/.babelrc +0 -3
  238. data/tracks/groovy/exercises/roman-numerals/Roman.groovy +0 -33
  239. data/tracks/groovy/exercises/word-count/PhraseSpec.groovy +0 -47
  240. data/tracks/scala/exercises/bowling/src/main/scala/Bowling.scala +0 -11
@@ -1,42 +1,17 @@
1
- [C++](https://en.wikipedia.org/wiki/C%2B%2B) (pronounced cee plus plus)
2
- is a general purpose programming language developed by
3
- [Bjarne Stroustrup](https://en.wikipedia.org/wiki/Bjarne_Stroustrup)
4
- starting in 1979 at Bell Labs. It is immensely popular, particularly
5
- for applications that require speed and/or access to some
6
- low-level features. It is considered to be an intermediate level
7
- language, as it encapsulates both high and low level language features.
1
+ [C++](https://en.wikipedia.org/wiki/C%2B%2B) (pronounced cee plus plus) is a general purpose programming language developed by [Bjarne Stroustrup](https://en.wikipedia.org/wiki/Bjarne_Stroustrup) starting in 1979 at Bell Labs. It is immensely popular, particularly for applications that require speed and/or access to some low-level features. It is considered to be an intermediate level language, as it encapsulates both high and low level language features.
8
2
 
9
- C++ supports [procedural](https://en.wikipedia.org/wiki/Procedural_programming),
10
- [object-oriented](https://en.wikipedia.org/wiki/Object-oriented_programming),
11
- [functional](https://en.wikipedia.org/wiki/Functional_programming)
12
- and [generic](https://en.wikipedia.org/wiki/Generic_programming)
13
- programming. Compilers for C++ are available for essentially every platform,
14
- including Windows, Mac OS, and Linux.
3
+ C++ supports [procedural](https://en.wikipedia.org/wiki/Procedural_programming), [object-oriented](https://en.wikipedia.org/wiki/Object-oriented_programming), [functional](https://en.wikipedia.org/wiki/Functional_programming) and [generic](https://en.wikipedia.org/wiki/Generic_programming) programming. Compilers for C++ are available for essentially every platform, including Windows, Mac OS, and Linux.
15
4
 
16
5
  Key Benefits:
17
- - Type safety
18
- - Encapsulate necessary unsafe operations
19
- - Resource safety
20
- - Not all resource management is managing memory
21
- - Performance
22
- - For some parts of almost all systems, it's important
23
- - Predictability
24
- - For hard and soft real-time systems
25
- - Teachability
26
- - Complexity of code should be proportional to the complexity of the task
27
- - Readability
28
- - People and machines ("analyzability")
29
- - Direct map to hardware
30
- - of instructions and fundamental data types
31
- - Zero-overhead abstraction
32
- - Classes with constructors and destructors, inheritance, generic
33
- programming, functional programming techniques
6
+ - **Type safety:** Encapsulate necessary unsafe operations
7
+ - **Resource safety:** Not all resource management is managing memory
8
+ - **Performance:** For some parts of almost all systems, it's important
9
+ - **Predictability:** For hard and soft real-time systems
10
+ - **Teachability:** Complexity of code should be proportional to the complexity of the task
11
+ - **Readability:** People and machines ("analyzability")
12
+ - **Direct map to hardware:** of instructions and fundamental data types
13
+ - **Zero-overhead abstraction:** Classes with constructors and destructors, inheritance, generic programming, functional programming techniques
34
14
 
35
- The standard for C++ is maintained by the International Organization for
36
- Standardization (ISO), and the current version of C++ as of December
37
- 2014 is C++14 (named not as the 14th version of C++, but rather
38
- signifying that the standard was ratified in 2014).
15
+ The standard for C++ is maintained by the International Organization for Standardization (ISO), and the current version of C++ as of December 2014 is C++14 (named not as the 14th version of C++, but rather signifying that the standard was ratified in 2014).
39
16
 
40
- The best thing about C++ is that it runs on everything from embedded
41
- processors with very limited resources to the largest mainframe
42
- supercomputer and every personal computer in between.
17
+ The best thing about C++ is that it runs on everything from embedded processors with very limited resources to the largest mainframe supercomputer and every personal computer in between.
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "language": "C#",
3
3
  "active": true,
4
+ "blurb": "C# is a modern, object-oriented language with lots of great features, such as type-inference and async/await. The official documentation is very extensive and well-written.",
4
5
  "exercises": [
5
6
  {
6
7
  "uuid": "6c88f46b-5acb-4fae-a6ec-b48ae3f8168f",
@@ -45,6 +46,17 @@
45
46
  "Transforming"
46
47
  ]
47
48
  },
49
+ {
50
+ "uuid": "57f02d0e-7b75-473b-892d-26a7d980c4ce",
51
+ "slug": "two-fer",
52
+ "core": true,
53
+ "unlocked_by": "null",
54
+ "difficulty": 1,
55
+ "topics": [
56
+ "Strings",
57
+ "Optional values"
58
+ ]
59
+ },
48
60
  {
49
61
  "uuid": "29ae7f8e-a009-4175-9350-a8c684c89730",
50
62
  "slug": "raindrops",
@@ -90,6 +102,20 @@
90
102
  "Sorting"
91
103
  ]
92
104
  },
105
+ {
106
+ "uuid": "c4efbf8a-8e76-4700-807d-830a4938f4d0",
107
+ "slug": "collatz-conjecture",
108
+ "core": false,
109
+ "unlocked_by": "sum-of-multiples",
110
+ "difficulty": 2,
111
+ "topics": [
112
+ "Control-flow (loops)",
113
+ "Control-flow (conditionals)",
114
+ "Integers",
115
+ "Algorithms",
116
+ "Mathematics"
117
+ ]
118
+ },
93
119
  {
94
120
  "uuid": "b7458404-2534-4ed8-8350-7060fa4b5786",
95
121
  "slug": "kindergarten-garden",
@@ -858,6 +884,17 @@
858
884
  "Transforming"
859
885
  ]
860
886
  },
887
+ {
888
+ "uuid": "bae1f3a4-b63d-4efd-921a-133b3d5e379c",
889
+ "slug": "spiral-matrix",
890
+ "core": false,
891
+ "unlocked_by": "matrix",
892
+ "difficulty": 5,
893
+ "topics": [
894
+ "Algorithms",
895
+ "Matrices"
896
+ ]
897
+ },
861
898
  {
862
899
  "uuid": "d9359f25-dc94-496c-adc3-57fe541857fe",
863
900
  "slug": "tournament",
@@ -49,6 +49,16 @@
49
49
  "link_text": null,
50
50
  "link_url": null,
51
51
  "avatar_url": null
52
+ },
53
+ {
54
+ "github_username": "jpreese",
55
+ "show_on_website": true,
56
+ "alumnus": false,
57
+ "name": "John Reese",
58
+ "bio": "I am a software engineer with a passion for testing and C#. If you have any questions about the C# track or the language in general, feel free to ask; I'd love to hear them.",
59
+ "link_text": "I sometimes write about stuff",
60
+ "link_url": "http://www.reesespieces.io/",
61
+ "avatar_url": null
52
62
  }
53
63
  ],
54
64
  "docs_url": "https://github.com/exercism/docs/blob/master/maintaining-a-track/maintainer-configuration.md"
@@ -1,5 +1,5 @@
1
1
  C# is a modern, object oriented language developed and maintained by Microsoft. The learning curve is small, reduced even if the developer has experience with other 'C-Style' languages.
2
2
 
3
- C# is a carefully designed language with lots of great features, such as type-inference and async/await. The official [documentation](https://docs.microsoft.com/en-us/dotnet/articles/csharp/) is very extensive and well-written.
3
+ C# is a carefully designed language with lots of great features, such as type-inference and async/await. The official [documentation](https://docs.microsoft.com/en-us/dotnet/csharp/) is very extensive and well-written.
4
4
 
5
5
  Although .NET used to be Windows-only, with the release of [.NET Core](https://www.microsoft.com/net/core) you can also use C# on Mac or Unix-based systems.
@@ -2,14 +2,14 @@
2
2
 
3
3
  ### Blogs
4
4
  * The official [.NET blog](https://blogs.msdn.microsoft.com/dotnet/) has lots of interesting C# articles, ranging from beginner to expert difficulty.
5
- * Scott Hanselman's [blog](http://www.hanselman.com/blog/) is an active, we'll written blog on a wide variety of C# and .NET related subjects.
5
+ * Scott Hanselman's [blog](http://www.hanselman.com/blog/) is an active, well written blog on a wide variety of C# and .NET related subjects.
6
6
  * Eric Lippert's [Fabulous adventures in coding](https://ericlippert.com/) is a brilliant C# blog, although his subjects are usually quite advanced.
7
7
  * The [C#/.NET Little Wonders & Little Pitfalls](http://geekswithblogs.net/BlackRabbitCoder/archive/2015/04/02/c.net-little-wonders-amp-little-pitfalls-the-complete-collection.aspx) posts by James Michael Hare contains some fantastic posts on less known C# features.
8
8
 
9
9
  ### Social media
10
10
  * [StackOverflow ](http://stackoverflow.com/questions/tagged/c%23) can be used to search for your problem and see if it has been answered already. You can also ask and answer questions.
11
11
  * [/r/csharp](https://www.reddit.com/r/csharp) is the C# subreddit.
12
- * [@dotnet](https://twitter.com/DotNet) is the official .NET Twitter account.
12
+ * [\@dotnet](https://twitter.com/DotNet) is the official .NET Twitter account.
13
13
  * [Gitter](https://gitter.im/exercism/xcsharp) is the C# Gitter room, go here to get support and ask questions related to the C# track.
14
14
 
15
15
  ### Videos
@@ -212,6 +212,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Zipper", "zipper\Zipper.csp
212
212
  EndProject
213
213
  Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RotationalCipher", "rotational-cipher\RotationalCipher.csproj", "{DF67FD2D-4897-43C5-A93E-7CCADBB29E75}"
214
214
  EndProject
215
+ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TwoFer", "two-fer\TwoFer.csproj", "{4B862F51-054D-467F-971D-8A7B72F5B498}"
216
+ EndProject
217
+ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpiralMatrix", "spiral-matrix\SpiralMatrix.csproj", "{05EF2C70-B5B0-4351-B940-041A03A6BB84}"
218
+ EndProject
219
+ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CollatzConjecture", "collatz-conjecture\CollatzConjecture.csproj", "{18BC2EE7-E798-40DE-A346-0B803137E67D}"
220
+ EndProject
215
221
  Global
216
222
  GlobalSection(SolutionConfigurationPlatforms) = preSolution
217
223
  Debug|Any CPU = Debug|Any CPU
@@ -1472,16 +1478,52 @@ Global
1472
1478
  {83504141-FF2A-427E-8A51-9FA0E9037A78}.Release|x86.Build.0 = Release|Any CPU
1473
1479
  {DF67FD2D-4897-43C5-A93E-7CCADBB29E75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1474
1480
  {DF67FD2D-4897-43C5-A93E-7CCADBB29E75}.Debug|Any CPU.Build.0 = Debug|Any CPU
1475
- {DF67FD2D-4897-43C5-A93E-7CCADBB29E75}.Debug|x64.ActiveCfg = Debug|x64
1476
- {DF67FD2D-4897-43C5-A93E-7CCADBB29E75}.Debug|x64.Build.0 = Debug|x64
1477
- {DF67FD2D-4897-43C5-A93E-7CCADBB29E75}.Debug|x86.ActiveCfg = Debug|x86
1478
- {DF67FD2D-4897-43C5-A93E-7CCADBB29E75}.Debug|x86.Build.0 = Debug|x86
1481
+ {DF67FD2D-4897-43C5-A93E-7CCADBB29E75}.Debug|x64.ActiveCfg = Debug|Any CPU
1482
+ {DF67FD2D-4897-43C5-A93E-7CCADBB29E75}.Debug|x64.Build.0 = Debug|Any CPU
1483
+ {DF67FD2D-4897-43C5-A93E-7CCADBB29E75}.Debug|x86.ActiveCfg = Debug|Any CPU
1484
+ {DF67FD2D-4897-43C5-A93E-7CCADBB29E75}.Debug|x86.Build.0 = Debug|Any CPU
1479
1485
  {DF67FD2D-4897-43C5-A93E-7CCADBB29E75}.Release|Any CPU.ActiveCfg = Release|Any CPU
1480
1486
  {DF67FD2D-4897-43C5-A93E-7CCADBB29E75}.Release|Any CPU.Build.0 = Release|Any CPU
1481
- {DF67FD2D-4897-43C5-A93E-7CCADBB29E75}.Release|x64.ActiveCfg = Release|x64
1482
- {DF67FD2D-4897-43C5-A93E-7CCADBB29E75}.Release|x64.Build.0 = Release|x64
1483
- {DF67FD2D-4897-43C5-A93E-7CCADBB29E75}.Release|x86.ActiveCfg = Release|x86
1484
- {DF67FD2D-4897-43C5-A93E-7CCADBB29E75}.Release|x86.Build.0 = Release|x86
1487
+ {DF67FD2D-4897-43C5-A93E-7CCADBB29E75}.Release|x64.ActiveCfg = Release|Any CPU
1488
+ {DF67FD2D-4897-43C5-A93E-7CCADBB29E75}.Release|x64.Build.0 = Release|Any CPU
1489
+ {DF67FD2D-4897-43C5-A93E-7CCADBB29E75}.Release|x86.ActiveCfg = Release|Any CPU
1490
+ {DF67FD2D-4897-43C5-A93E-7CCADBB29E75}.Release|x86.Build.0 = Release|Any CPU
1491
+ {4B862F51-054D-467F-971D-8A7B72F5B498}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1492
+ {4B862F51-054D-467F-971D-8A7B72F5B498}.Debug|Any CPU.Build.0 = Debug|Any CPU
1493
+ {4B862F51-054D-467F-971D-8A7B72F5B498}.Debug|x64.ActiveCfg = Debug|Any CPU
1494
+ {4B862F51-054D-467F-971D-8A7B72F5B498}.Debug|x64.Build.0 = Debug|Any CPU
1495
+ {4B862F51-054D-467F-971D-8A7B72F5B498}.Debug|x86.ActiveCfg = Debug|Any CPU
1496
+ {4B862F51-054D-467F-971D-8A7B72F5B498}.Debug|x86.Build.0 = Debug|Any CPU
1497
+ {4B862F51-054D-467F-971D-8A7B72F5B498}.Release|Any CPU.ActiveCfg = Release|Any CPU
1498
+ {4B862F51-054D-467F-971D-8A7B72F5B498}.Release|Any CPU.Build.0 = Release|Any CPU
1499
+ {4B862F51-054D-467F-971D-8A7B72F5B498}.Release|x64.ActiveCfg = Release|Any CPU
1500
+ {4B862F51-054D-467F-971D-8A7B72F5B498}.Release|x64.Build.0 = Release|Any CPU
1501
+ {4B862F51-054D-467F-971D-8A7B72F5B498}.Release|x86.ActiveCfg = Release|Any CPU
1502
+ {4B862F51-054D-467F-971D-8A7B72F5B498}.Release|x86.Build.0 = Release|Any CPU
1503
+ {05EF2C70-B5B0-4351-B940-041A03A6BB84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1504
+ {05EF2C70-B5B0-4351-B940-041A03A6BB84}.Debug|Any CPU.Build.0 = Debug|Any CPU
1505
+ {05EF2C70-B5B0-4351-B940-041A03A6BB84}.Debug|x64.ActiveCfg = Debug|Any CPU
1506
+ {05EF2C70-B5B0-4351-B940-041A03A6BB84}.Debug|x64.Build.0 = Debug|Any CPU
1507
+ {05EF2C70-B5B0-4351-B940-041A03A6BB84}.Debug|x86.ActiveCfg = Debug|Any CPU
1508
+ {05EF2C70-B5B0-4351-B940-041A03A6BB84}.Debug|x86.Build.0 = Debug|Any CPU
1509
+ {05EF2C70-B5B0-4351-B940-041A03A6BB84}.Release|Any CPU.ActiveCfg = Release|Any CPU
1510
+ {05EF2C70-B5B0-4351-B940-041A03A6BB84}.Release|Any CPU.Build.0 = Release|Any CPU
1511
+ {05EF2C70-B5B0-4351-B940-041A03A6BB84}.Release|x64.ActiveCfg = Release|Any CPU
1512
+ {05EF2C70-B5B0-4351-B940-041A03A6BB84}.Release|x64.Build.0 = Release|Any CPU
1513
+ {05EF2C70-B5B0-4351-B940-041A03A6BB84}.Release|x86.ActiveCfg = Release|Any CPU
1514
+ {05EF2C70-B5B0-4351-B940-041A03A6BB84}.Release|x86.Build.0 = Release|Any CPU
1515
+ {18BC2EE7-E798-40DE-A346-0B803137E67D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1516
+ {18BC2EE7-E798-40DE-A346-0B803137E67D}.Debug|Any CPU.Build.0 = Debug|Any CPU
1517
+ {18BC2EE7-E798-40DE-A346-0B803137E67D}.Debug|x64.ActiveCfg = Debug|Any CPU
1518
+ {18BC2EE7-E798-40DE-A346-0B803137E67D}.Debug|x64.Build.0 = Debug|Any CPU
1519
+ {18BC2EE7-E798-40DE-A346-0B803137E67D}.Debug|x86.ActiveCfg = Debug|Any CPU
1520
+ {18BC2EE7-E798-40DE-A346-0B803137E67D}.Debug|x86.Build.0 = Debug|Any CPU
1521
+ {18BC2EE7-E798-40DE-A346-0B803137E67D}.Release|Any CPU.ActiveCfg = Release|Any CPU
1522
+ {18BC2EE7-E798-40DE-A346-0B803137E67D}.Release|Any CPU.Build.0 = Release|Any CPU
1523
+ {18BC2EE7-E798-40DE-A346-0B803137E67D}.Release|x64.ActiveCfg = Release|Any CPU
1524
+ {18BC2EE7-E798-40DE-A346-0B803137E67D}.Release|x64.Build.0 = Release|Any CPU
1525
+ {18BC2EE7-E798-40DE-A346-0B803137E67D}.Release|x86.ActiveCfg = Release|Any CPU
1526
+ {18BC2EE7-E798-40DE-A346-0B803137E67D}.Release|x86.Build.0 = Release|Any CPU
1485
1527
  EndGlobalSection
1486
1528
  GlobalSection(SolutionProperties) = preSolution
1487
1529
  HideSolutionNode = FALSE
@@ -206,6 +206,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Zipper", "zipper\Zipper.csp
206
206
  EndProject
207
207
  Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RotationalCipher", "rotational-cipher\RotationalCipher.csproj", "{F72CEE93-2F93-4408-8FCC-FBEB3AF0C285}"
208
208
  EndProject
209
+ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TwoFer", "two-fer\TwoFer.csproj", "{F82A2061-8DE1-4A54-882F-6D57A5518B37}"
210
+ EndProject
211
+ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpiralMatrix", "spiral-matrix\SpiralMatrix.csproj", "{0D1B97CC-3395-481C-A6ED-B26063729241}"
212
+ EndProject
213
+ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CollatzConjecture", "collatz-conjecture\CollatzConjecture.csproj", "{37BA7FE8-84D3-45BB-9BDA-51917B951F40}"
214
+ EndProject
209
215
  Global
210
216
  GlobalSection(SolutionConfigurationPlatforms) = preSolution
211
217
  Debug|Any CPU = Debug|Any CPU
@@ -1430,16 +1436,52 @@ Global
1430
1436
  {83504141-FF2A-427E-8A51-9FA0E9037A78}.Release|x86.Build.0 = Release|Any CPU
1431
1437
  {F72CEE93-2F93-4408-8FCC-FBEB3AF0C285}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1432
1438
  {F72CEE93-2F93-4408-8FCC-FBEB3AF0C285}.Debug|Any CPU.Build.0 = Debug|Any CPU
1433
- {F72CEE93-2F93-4408-8FCC-FBEB3AF0C285}.Debug|x64.ActiveCfg = Debug|x64
1434
- {F72CEE93-2F93-4408-8FCC-FBEB3AF0C285}.Debug|x64.Build.0 = Debug|x64
1435
- {F72CEE93-2F93-4408-8FCC-FBEB3AF0C285}.Debug|x86.ActiveCfg = Debug|x86
1436
- {F72CEE93-2F93-4408-8FCC-FBEB3AF0C285}.Debug|x86.Build.0 = Debug|x86
1439
+ {F72CEE93-2F93-4408-8FCC-FBEB3AF0C285}.Debug|x64.ActiveCfg = Debug|Any CPU
1440
+ {F72CEE93-2F93-4408-8FCC-FBEB3AF0C285}.Debug|x64.Build.0 = Debug|Any CPU
1441
+ {F72CEE93-2F93-4408-8FCC-FBEB3AF0C285}.Debug|x86.ActiveCfg = Debug|Any CPU
1442
+ {F72CEE93-2F93-4408-8FCC-FBEB3AF0C285}.Debug|x86.Build.0 = Debug|Any CPU
1437
1443
  {F72CEE93-2F93-4408-8FCC-FBEB3AF0C285}.Release|Any CPU.ActiveCfg = Release|Any CPU
1438
1444
  {F72CEE93-2F93-4408-8FCC-FBEB3AF0C285}.Release|Any CPU.Build.0 = Release|Any CPU
1439
- {F72CEE93-2F93-4408-8FCC-FBEB3AF0C285}.Release|x64.ActiveCfg = Release|x64
1440
- {F72CEE93-2F93-4408-8FCC-FBEB3AF0C285}.Release|x64.Build.0 = Release|x64
1441
- {F72CEE93-2F93-4408-8FCC-FBEB3AF0C285}.Release|x86.ActiveCfg = Release|x86
1442
- {F72CEE93-2F93-4408-8FCC-FBEB3AF0C285}.Release|x86.Build.0 = Release|x86
1445
+ {F72CEE93-2F93-4408-8FCC-FBEB3AF0C285}.Release|x64.ActiveCfg = Release|Any CPU
1446
+ {F72CEE93-2F93-4408-8FCC-FBEB3AF0C285}.Release|x64.Build.0 = Release|Any CPU
1447
+ {F72CEE93-2F93-4408-8FCC-FBEB3AF0C285}.Release|x86.ActiveCfg = Release|Any CPU
1448
+ {F72CEE93-2F93-4408-8FCC-FBEB3AF0C285}.Release|x86.Build.0 = Release|Any CPU
1449
+ {F82A2061-8DE1-4A54-882F-6D57A5518B37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1450
+ {F82A2061-8DE1-4A54-882F-6D57A5518B37}.Debug|Any CPU.Build.0 = Debug|Any CPU
1451
+ {F82A2061-8DE1-4A54-882F-6D57A5518B37}.Debug|x64.ActiveCfg = Debug|Any CPU
1452
+ {F82A2061-8DE1-4A54-882F-6D57A5518B37}.Debug|x64.Build.0 = Debug|Any CPU
1453
+ {F82A2061-8DE1-4A54-882F-6D57A5518B37}.Debug|x86.ActiveCfg = Debug|Any CPU
1454
+ {F82A2061-8DE1-4A54-882F-6D57A5518B37}.Debug|x86.Build.0 = Debug|Any CPU
1455
+ {F82A2061-8DE1-4A54-882F-6D57A5518B37}.Release|Any CPU.ActiveCfg = Release|Any CPU
1456
+ {F82A2061-8DE1-4A54-882F-6D57A5518B37}.Release|Any CPU.Build.0 = Release|Any CPU
1457
+ {F82A2061-8DE1-4A54-882F-6D57A5518B37}.Release|x64.ActiveCfg = Release|Any CPU
1458
+ {F82A2061-8DE1-4A54-882F-6D57A5518B37}.Release|x64.Build.0 = Release|Any CPU
1459
+ {F82A2061-8DE1-4A54-882F-6D57A5518B37}.Release|x86.ActiveCfg = Release|Any CPU
1460
+ {F82A2061-8DE1-4A54-882F-6D57A5518B37}.Release|x86.Build.0 = Release|Any CPU
1461
+ {0D1B97CC-3395-481C-A6ED-B26063729241}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1462
+ {0D1B97CC-3395-481C-A6ED-B26063729241}.Debug|Any CPU.Build.0 = Debug|Any CPU
1463
+ {0D1B97CC-3395-481C-A6ED-B26063729241}.Debug|x64.ActiveCfg = Debug|Any CPU
1464
+ {0D1B97CC-3395-481C-A6ED-B26063729241}.Debug|x64.Build.0 = Debug|Any CPU
1465
+ {0D1B97CC-3395-481C-A6ED-B26063729241}.Debug|x86.ActiveCfg = Debug|Any CPU
1466
+ {0D1B97CC-3395-481C-A6ED-B26063729241}.Debug|x86.Build.0 = Debug|Any CPU
1467
+ {0D1B97CC-3395-481C-A6ED-B26063729241}.Release|Any CPU.ActiveCfg = Release|Any CPU
1468
+ {0D1B97CC-3395-481C-A6ED-B26063729241}.Release|Any CPU.Build.0 = Release|Any CPU
1469
+ {0D1B97CC-3395-481C-A6ED-B26063729241}.Release|x64.ActiveCfg = Release|Any CPU
1470
+ {0D1B97CC-3395-481C-A6ED-B26063729241}.Release|x64.Build.0 = Release|Any CPU
1471
+ {0D1B97CC-3395-481C-A6ED-B26063729241}.Release|x86.ActiveCfg = Release|Any CPU
1472
+ {0D1B97CC-3395-481C-A6ED-B26063729241}.Release|x86.Build.0 = Release|Any CPU
1473
+ {37BA7FE8-84D3-45BB-9BDA-51917B951F40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1474
+ {37BA7FE8-84D3-45BB-9BDA-51917B951F40}.Debug|Any CPU.Build.0 = Debug|Any CPU
1475
+ {37BA7FE8-84D3-45BB-9BDA-51917B951F40}.Debug|x64.ActiveCfg = Debug|Any CPU
1476
+ {37BA7FE8-84D3-45BB-9BDA-51917B951F40}.Debug|x64.Build.0 = Debug|Any CPU
1477
+ {37BA7FE8-84D3-45BB-9BDA-51917B951F40}.Debug|x86.ActiveCfg = Debug|Any CPU
1478
+ {37BA7FE8-84D3-45BB-9BDA-51917B951F40}.Debug|x86.Build.0 = Debug|Any CPU
1479
+ {37BA7FE8-84D3-45BB-9BDA-51917B951F40}.Release|Any CPU.ActiveCfg = Release|Any CPU
1480
+ {37BA7FE8-84D3-45BB-9BDA-51917B951F40}.Release|Any CPU.Build.0 = Release|Any CPU
1481
+ {37BA7FE8-84D3-45BB-9BDA-51917B951F40}.Release|x64.ActiveCfg = Release|Any CPU
1482
+ {37BA7FE8-84D3-45BB-9BDA-51917B951F40}.Release|x64.Build.0 = Release|Any CPU
1483
+ {37BA7FE8-84D3-45BB-9BDA-51917B951F40}.Release|x86.ActiveCfg = Release|Any CPU
1484
+ {37BA7FE8-84D3-45BB-9BDA-51917B951F40}.Release|x86.Build.0 = Release|Any CPU
1443
1485
  EndGlobalSection
1444
1486
  GlobalSection(SolutionProperties) = preSolution
1445
1487
  HideSolutionNode = FALSE
@@ -0,0 +1,9 @@
1
+ using System;
2
+
3
+ public static class CollatzConjecture
4
+ {
5
+ public static int GetSteps(int input)
6
+ {
7
+ throw new NotImplementedException("You need to implement this function");
8
+ }
9
+ }
@@ -0,0 +1,18 @@
1
+ <Project Sdk="Microsoft.NET.Sdk">
2
+
3
+ <PropertyGroup>
4
+ <OutputType>Exe</OutputType>
5
+ <TargetFramework>netcoreapp1.0</TargetFramework>
6
+ </PropertyGroup>
7
+
8
+ <ItemGroup>
9
+ <Compile Remove="Example.cs" />
10
+ </ItemGroup>
11
+
12
+ <ItemGroup>
13
+ <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
14
+ <PackageReference Include="xunit" Version="2.2.0" />
15
+ <PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
16
+ </ItemGroup>
17
+
18
+ </Project>
@@ -0,0 +1,43 @@
1
+ // This file was auto-generated based on version 1.0.0 of the canonical data.
2
+
3
+ using System;
4
+ using Xunit;
5
+
6
+ public class CollatzConjectureTest
7
+ {
8
+ [Fact]
9
+ public void Zero_steps_for_one()
10
+ {
11
+ Assert.Equal(0, CollatzConjecture.GetSteps(1));
12
+ }
13
+
14
+ [Fact(Skip = "Remove to run test")]
15
+ public void Divide_if_even()
16
+ {
17
+ Assert.Equal(4, CollatzConjecture.GetSteps(16));
18
+ }
19
+
20
+ [Fact(Skip = "Remove to run test")]
21
+ public void Even_and_odd_steps()
22
+ {
23
+ Assert.Equal(9, CollatzConjecture.GetSteps(12));
24
+ }
25
+
26
+ [Fact(Skip = "Remove to run test")]
27
+ public void Large_number_of_even_and_odd_steps()
28
+ {
29
+ Assert.Equal(152, CollatzConjecture.GetSteps(1000000));
30
+ }
31
+
32
+ [Fact(Skip = "Remove to run test")]
33
+ public void Zero_is_an_error()
34
+ {
35
+ Assert.Throws<ArgumentException>(() => CollatzConjecture.GetSteps(0));
36
+ }
37
+
38
+ [Fact(Skip = "Remove to run test")]
39
+ public void Negative_value_is_an_error()
40
+ {
41
+ Assert.Throws<ArgumentException>(() => CollatzConjecture.GetSteps(-15));
42
+ }
43
+ }
@@ -0,0 +1,30 @@
1
+ using System;
2
+
3
+ public static class CollatzConjecture
4
+ {
5
+ public static int GetSteps(int input)
6
+ {
7
+ if(input <= 0)
8
+ {
9
+ throw new ArgumentException("Only positive numbers are allowed");
10
+ }
11
+
12
+ int stepCount = 0;
13
+
14
+ while(input != 1)
15
+ {
16
+ if(input % 2 == 0)
17
+ {
18
+ input /= 2;
19
+ }
20
+ else
21
+ {
22
+ input = (input * 3) + 1;
23
+ }
24
+
25
+ stepCount++;
26
+ }
27
+
28
+ return stepCount;
29
+ }
30
+ }
@@ -0,0 +1,38 @@
1
+ # Collatz Conjecture
2
+
3
+ The Collatz Conjecture or 3x+1 problem can be summarized as follows:
4
+
5
+ Take any positive integer n. If n is even, divide n by 2 to get n / 2. If n is
6
+ odd, multiply n by 3 and add 1 to get 3n + 1. Repeat the process indefinitely.
7
+ The conjecture states that no matter which number you start with, you will
8
+ always reach 1 eventually.
9
+
10
+ Given a number n, return the number of steps required to reach 1.
11
+
12
+ ## Examples
13
+ Starting with n = 12, the steps would be as follows:
14
+
15
+ 0. 12
16
+ 1. 6
17
+ 2. 3
18
+ 3. 10
19
+ 4. 5
20
+ 5. 16
21
+ 6. 8
22
+ 7. 4
23
+ 8. 2
24
+ 9. 1
25
+
26
+ Resulting in 9 steps. So for input n = 12, the return value would be 9.
27
+
28
+ ### Submitting Exercises
29
+
30
+ Note that, when trying to submit an exercise, make sure the exercise file that you're submitting is in the `exercism/csharp/<exerciseName>` directory.
31
+
32
+ For example, if you're submitting `bob.cs` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/csharp/bob/bob.cs`.
33
+
34
+ ## Source
35
+ An unsolved problem in mathematics named after mathematician Lothar Collatz [https://en.wikipedia.org/wiki/3x_%2B_1_problem](https://en.wikipedia.org/wiki/3x_%2B_1_problem)
36
+
37
+ ## Submitting Incomplete Solutions
38
+ It's possible to submit an incomplete solution so you can see how others have completed the exercise.