trackler 2.2.1.98 → 2.2.1.99

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/exercises/complex-numbers/canonical-data.json +47 -47
  4. data/problem-specifications/exercises/custom-set/canonical-data.json +13 -7
  5. data/tracks/delphi/exercises/phone-number/uPhoneNumberTests.pas +1 -1
  6. data/tracks/elixir/exercises/protein-translation/protein_translation_test.exs +5 -0
  7. data/tracks/fsharp/config.json +10 -0
  8. data/tracks/fsharp/exercises/Exercises.sln +6 -0
  9. data/tracks/fsharp/exercises/accumulate/AccumulateTest.fs +2 -0
  10. data/tracks/fsharp/exercises/bank-account/BankAccountTest.fs +2 -0
  11. data/tracks/fsharp/exercises/binary-search-tree/BinarySearchTreeTest.fs +2 -0
  12. data/tracks/fsharp/exercises/binary/BinaryTest.fs +2 -0
  13. data/tracks/fsharp/exercises/circular-buffer/CircularBufferTest.fs +121 -117
  14. data/tracks/fsharp/exercises/complex-numbers/ComplexNumbers.fs +21 -0
  15. data/tracks/fsharp/exercises/complex-numbers/ComplexNumbers.fsproj +23 -0
  16. data/tracks/fsharp/exercises/complex-numbers/ComplexNumbersTest.fs +168 -0
  17. data/tracks/fsharp/exercises/complex-numbers/Example.fs +27 -0
  18. data/tracks/fsharp/exercises/complex-numbers/Program.fs +1 -0
  19. data/tracks/fsharp/exercises/complex-numbers/README.md +35 -0
  20. data/tracks/fsharp/exercises/diamond/DiamondTest.fs +2 -0
  21. data/tracks/fsharp/exercises/diffie-hellman/DiffieHellmanTest.fs +2 -0
  22. data/tracks/fsharp/exercises/dot-dsl/DotDslTest.fs +2 -0
  23. data/tracks/fsharp/exercises/error-handling/ErrorHandlingTest.fs +2 -0
  24. data/tracks/fsharp/exercises/go-counting/GoCountingTest.fs +2 -0
  25. data/tracks/fsharp/exercises/grade-school/GradeSchoolTest.fs +2 -0
  26. data/tracks/fsharp/exercises/hangman/HangmanTest.fs +2 -0
  27. data/tracks/fsharp/exercises/hexadecimal/HexadecimalTest.fs +2 -0
  28. data/tracks/fsharp/exercises/ledger/LedgerTest.fs +2 -0
  29. data/tracks/fsharp/exercises/lens-person/LensPersonTest.fs +2 -0
  30. data/tracks/fsharp/exercises/linked-list/LinkedListTest.fs +2 -0
  31. data/tracks/fsharp/exercises/matrix/MatrixTest.fs +2 -0
  32. data/tracks/fsharp/exercises/octal/OctalTest.fs +2 -0
  33. data/tracks/fsharp/exercises/parallel-letter-frequency/ParallelLetterFrequencyTest.fs +2 -0
  34. data/tracks/fsharp/exercises/pov/PovTest.fs +2 -0
  35. data/tracks/fsharp/exercises/protein-translation/ProteinTranslationTest.fs +2 -0
  36. data/tracks/fsharp/exercises/pythagorean-triplet/PythagoreanTripletTest.fs +2 -0
  37. data/tracks/fsharp/exercises/robot-name/RobotNameTest.fs +2 -0
  38. data/tracks/fsharp/exercises/saddle-points/SaddlePointsTest.fs +2 -0
  39. data/tracks/fsharp/exercises/say/SayTest.fs +2 -0
  40. data/tracks/fsharp/exercises/scale-generator/ScaleGeneratorTest.fs +2 -0
  41. data/tracks/fsharp/exercises/secret-handshake/SecretHandshakeTest.fs +2 -0
  42. data/tracks/fsharp/exercises/series/SeriesTest.fs +2 -0
  43. data/tracks/fsharp/exercises/sgf-parsing/SgfParsingTest.fs +2 -0
  44. data/tracks/fsharp/exercises/sieve/SieveTest.fs +2 -0
  45. data/tracks/fsharp/exercises/simple-cipher/SimpleCipherTest.fs +2 -0
  46. data/tracks/fsharp/exercises/simple-linked-list/SimpleLinkedListTest.fs +2 -0
  47. data/tracks/fsharp/exercises/space-age/SpaceAgeTest.fs +2 -0
  48. data/tracks/fsharp/exercises/strain/StrainTest.fs +2 -0
  49. data/tracks/fsharp/exercises/sublist/SublistTest.fs +2 -0
  50. data/tracks/fsharp/exercises/sum-of-multiples/SumOfMultiplesTest.fs +2 -0
  51. data/tracks/fsharp/exercises/tournament/TournamentTest.fs +2 -0
  52. data/tracks/fsharp/exercises/transpose/TransposeTest.fs +2 -0
  53. data/tracks/fsharp/exercises/transpose/TrinaryTest.fs +3 -1
  54. data/tracks/fsharp/exercises/tree-building/TreeBuildingTest.fs +2 -0
  55. data/tracks/fsharp/exercises/triangle/TriangleTest.fs +2 -0
  56. data/tracks/fsharp/exercises/trinary/TrinaryTest.fs +2 -0
  57. data/tracks/fsharp/exercises/two-bucket/TwoBucketTest.fs +2 -0
  58. data/tracks/fsharp/exercises/variable-length-quantity/VariableLengthQuantityTest.fs +2 -0
  59. data/tracks/fsharp/exercises/word-count/WordCountTest.fs +2 -0
  60. data/tracks/fsharp/exercises/word-search/WordSearchTest.fs +2 -0
  61. data/tracks/fsharp/exercises/wordy/WordyTest.fs +2 -0
  62. data/tracks/fsharp/exercises/zebra-puzzle/ZebraPuzzleTest.fs +2 -0
  63. data/tracks/fsharp/exercises/zipper/ZipperTest.fs +2 -0
  64. data/tracks/fsharp/generators/CanonicalData.fs +1 -1
  65. data/tracks/fsharp/generators/Generators.fs +89 -0
  66. data/tracks/go/config.json +16 -0
  67. data/tracks/go/exercises/rail-fence-cipher/.meta/gen.go +82 -0
  68. data/tracks/go/exercises/rail-fence-cipher/README.md +83 -0
  69. data/tracks/go/exercises/rail-fence-cipher/cases_test.go +50 -0
  70. data/tracks/go/exercises/rail-fence-cipher/example.go +58 -0
  71. data/tracks/go/exercises/rail-fence-cipher/rail_fence_cipher_test.go +15 -0
  72. data/tracks/go/exercises/say/.meta/gen.go +5 -3
  73. data/tracks/go/exercises/say/cases_test.go +2 -2
  74. data/tracks/go/exercises/scrabble-score/.meta/gen.go +5 -3
  75. data/tracks/go/exercises/scrabble-score/cases_test.go +2 -2
  76. data/tracks/go/exercises/secret-handshake/.meta/gen.go +5 -3
  77. data/tracks/go/exercises/secret-handshake/cases_test.go +2 -2
  78. data/tracks/go/exercises/transpose/.meta/gen.go +5 -3
  79. data/tracks/go/exercises/transpose/cases_test.go +30 -76
  80. data/tracks/go/exercises/word-count/.meta/gen.go +5 -3
  81. data/tracks/go/exercises/word-count/cases_test.go +2 -2
  82. data/tracks/go/exercises/wordy/.meta/gen.go +5 -3
  83. data/tracks/go/exercises/wordy/cases_test.go +2 -2
  84. data/tracks/java/exercises/largest-series-product/.meta/src/reference/java/LargestSeriesProductCalculator.java +1 -3
  85. data/tracks/java/exercises/largest-series-product/.meta/version +1 -0
  86. data/tracks/java/exercises/largest-series-product/src/test/java/LargestSeriesProductCalculatorTest.java +9 -44
  87. data/tracks/ocaml/exercises/grade-school/.meta/description.md +21 -0
  88. data/tracks/ocaml/exercises/palindrome-products/.meta/description.md +35 -0
  89. data/tracks/ocaml/exercises/palindrome-products/README.md +13 -9
  90. metadata +16 -2
@@ -33,9 +33,7 @@ final class LargestSeriesProductCalculator {
33
33
  }
34
34
 
35
35
  private void validateStringToSearch() throws IllegalArgumentException {
36
- if (stringToSearch == null) {
37
- throw new IllegalArgumentException("String to search must be non-null.");
38
- } else if (!stringToSearch.chars().allMatch(Character::isDigit)) {
36
+ if (!stringToSearch.chars().allMatch(Character::isDigit)) {
39
37
  throw new IllegalArgumentException("String to search may only contain digits.");
40
38
  }
41
39
  }
@@ -11,9 +11,9 @@ public class LargestSeriesProductCalculatorTest {
11
11
  public ExpectedException expectedException = ExpectedException.none();
12
12
 
13
13
  @Test
14
- public void testCorrectlyCalculatesLargestProductOfLengthTwoWithNumbersInOrder() {
15
- final LargestSeriesProductCalculator calculator = new LargestSeriesProductCalculator("0123456789");
16
- final long expectedProduct = 72;
14
+ public void testCorrectlyCalculatesLargestProductWhenSeriesLengthEqualsStringToSearchLength() {
15
+ final LargestSeriesProductCalculator calculator = new LargestSeriesProductCalculator("29");
16
+ final long expectedProduct = 18;
17
17
 
18
18
  final long actualProduct = calculator.calculateLargestProductForSeriesLength(2);
19
19
 
@@ -22,9 +22,9 @@ public class LargestSeriesProductCalculatorTest {
22
22
 
23
23
  @Ignore("Remove to run test")
24
24
  @Test
25
- public void testCorrectlyCalculatesLargestProductOfLengthTwoWithNumbersNotInOrder() {
26
- final LargestSeriesProductCalculator calculator = new LargestSeriesProductCalculator("576802143");
27
- final long expectedProduct = 48;
25
+ public void testCorrectlyCalculatesLargestProductOfLengthTwoWithNumbersInOrder() {
26
+ final LargestSeriesProductCalculator calculator = new LargestSeriesProductCalculator("0123456789");
27
+ final long expectedProduct = 72;
28
28
 
29
29
  final long actualProduct = calculator.calculateLargestProductForSeriesLength(2);
30
30
 
@@ -33,9 +33,9 @@ public class LargestSeriesProductCalculatorTest {
33
33
 
34
34
  @Ignore("Remove to run test")
35
35
  @Test
36
- public void testCorrectlyCalculatesLargestProductWhenSeriesLengthEqualsStringToSearchLength() {
37
- final LargestSeriesProductCalculator calculator = new LargestSeriesProductCalculator("29");
38
- final long expectedProduct = 18;
36
+ public void testCorrectlyCalculatesLargestProductOfLengthTwoWithNumbersNotInOrder() {
37
+ final LargestSeriesProductCalculator calculator = new LargestSeriesProductCalculator("576802143");
38
+ final long expectedProduct = 48;
39
39
 
40
40
  final long actualProduct = calculator.calculateLargestProductForSeriesLength(2);
41
41
 
@@ -88,32 +88,6 @@ public class LargestSeriesProductCalculatorTest {
88
88
  assertEquals(expectedProduct, actualProduct);
89
89
  }
90
90
 
91
- @Ignore("Remove to run test")
92
- @Test
93
- public void testCorrectlyCalculatesLargestProductInLongStringToSearchV2() {
94
- final LargestSeriesProductCalculator calculator
95
- = new LargestSeriesProductCalculator("52677741234314237566414902593461595376319419139427");
96
-
97
- final long expectedProduct = 28350;
98
-
99
- final long actualProduct = calculator.calculateLargestProductForSeriesLength(6);
100
-
101
- assertEquals(expectedProduct, actualProduct);
102
- }
103
-
104
- @Ignore("Remove to run test")
105
- @Test
106
- public void testCorrectlyCalculatesLargestProductInLongStringToSearchFromProjectEuler() {
107
- final LargestSeriesProductCalculator calculator
108
- = new LargestSeriesProductCalculator("7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450");
109
-
110
- final long expectedProduct = 23514624000L;
111
-
112
- final long actualProduct = calculator.calculateLargestProductForSeriesLength(13);
113
-
114
- assertEquals(expectedProduct, actualProduct);
115
- }
116
-
117
91
  @Ignore("Remove to run test")
118
92
  @Test
119
93
  public void testCorrectlyCalculatesLargestProductOfZeroIfAllDigitsAreZeroes() {
@@ -202,13 +176,4 @@ public class LargestSeriesProductCalculatorTest {
202
176
  calculator.calculateLargestProductForSeriesLength(-1);
203
177
  }
204
178
 
205
- @Ignore("Remove to run test")
206
- @Test
207
- public void testNullStringToSearchIsRejected() {
208
- expectedException.expect(IllegalArgumentException.class);
209
- expectedException.expectMessage("String to search must be non-null.");
210
-
211
- new LargestSeriesProductCalculator(null);
212
- }
213
-
214
179
  }
@@ -0,0 +1,21 @@
1
+ Given students' names along with the grade that they are in, create a roster
2
+ for the school.
3
+
4
+ In the end, you should be able to:
5
+
6
+ - Start with an empty school.
7
+ - Add a student's name to the roster for a grade
8
+ - "Add Jim to grade 2."
9
+ - "OK."
10
+ - Get a list of all students enrolled in a grade
11
+ - "Which students are in grade 2?"
12
+ - "We've only got Jim just now."
13
+ - Get a sorted list of all students in all grades. Grades should sort
14
+ as 1, 2, 3, etc., and students within a grade should be sorted
15
+ alphabetically by name.
16
+ - "Who all is enrolled in school right now?"
17
+ - "Grade 1: Anna, Barb, and Charlie. Grade 2: Alex, Peter, and Zoe.
18
+ Grade 3…"
19
+
20
+ Note that all our students only have one name. (It's a small town, what
21
+ do you want?)
@@ -0,0 +1,35 @@
1
+ Detect palindrome products in a given range.
2
+
3
+ A palindromic number is a number that remains the same when its digits are
4
+ reversed. For example, `121` is a palindromic number but `112` is not.
5
+
6
+ Given a range of numbers, find the largest and smallest palindromes which
7
+ are products of numbers within that range.
8
+
9
+ Your solution should return the largest and smallest palindromes, along with the
10
+ factors of each within the range. If the largest or smallest palindrome has more
11
+ than one pair of factors within the range, then return all the pairs.
12
+
13
+ Not all ranges of factors can produce a Palindrome, and ranges must have their
14
+ max at least as large as their min. This exercise uses the OCaml `Result.t`
15
+ type to specify errors.
16
+
17
+ ## Example 1
18
+
19
+ Given the range `[1, 9]` (both inclusive)...
20
+
21
+ And given the list of all possible products within this range:
22
+ `[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 15, 21, 24, 27, 20, 28, 32, 36, 25, 30, 35, 40, 45, 42, 48, 54, 49, 56, 63, 64, 72, 81]`
23
+
24
+ The palindrome products are all single digit numbers (in this case):
25
+ `[1, 2, 3, 4, 5, 6, 7, 8, 9]`
26
+
27
+ The smallest palindrome product is `1`. Its factors are `(1, 1)`.
28
+ The largest palindrome product is `9`. Its factors are `(1, 9)` and `(3, 3)`.
29
+
30
+ ## Example 2
31
+
32
+ Given the range `[10, 99]` (both inclusive)...
33
+
34
+ The smallest palindrome product is `121`. Its factors are `(11, 11)`.
35
+ The largest palindrome product is `9009`. Its factors are `(91, 99)`.
@@ -9,26 +9,32 @@ Given a range of numbers, find the largest and smallest palindromes which
9
9
  are products of numbers within that range.
10
10
 
11
11
  Your solution should return the largest and smallest palindromes, along with the
12
- factors of each within the range. If the largest or smallest palindrome has more
12
+ factors of each within the range. If the largest or smallest palindrome has more
13
13
  than one pair of factors within the range, then return all the pairs.
14
14
 
15
- Not all ranges of factors can produce a Palindrome, and ranges must have their
16
- max at least as large as their min. This exercise uses the OCaml `Result.t`
15
+ Not all ranges of factors can produce a Palindrome, and ranges must have their
16
+ max at least as large as their min. This exercise uses the OCaml `Result.t`
17
17
  type to specify errors.
18
18
 
19
19
  ## Example 1
20
20
 
21
21
  Given the range `[1, 9]` (both inclusive)...
22
22
 
23
- The smallest product is `1`. Its factors are `(1, 1)`.
24
- The largest product is `9`. Its factors are `(1, 9)`, and `(3, 3)`.
23
+ And given the list of all possible products within this range:
24
+ `[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 15, 21, 24, 27, 20, 28, 32, 36, 25, 30, 35, 40, 45, 42, 48, 54, 49, 56, 63, 64, 72, 81]`
25
+
26
+ The palindrome products are all single digit numbers (in this case):
27
+ `[1, 2, 3, 4, 5, 6, 7, 8, 9]`
28
+
29
+ The smallest palindrome product is `1`. Its factors are `(1, 1)`.
30
+ The largest palindrome product is `9`. Its factors are `(1, 9)` and `(3, 3)`.
25
31
 
26
32
  ## Example 2
27
33
 
28
34
  Given the range `[10, 99]` (both inclusive)...
29
35
 
30
36
  The smallest palindrome product is `121`. Its factors are `(11, 11)`.
31
- The largest palindrome product is `9009`. Its factors are `(91, 99)` and `(99, 91)`.
37
+ The largest palindrome product is `9009`. Its factors are `(91, 99)`.
32
38
 
33
39
 
34
40
  ## Getting Started
@@ -71,9 +77,7 @@ one, head over there and create an issue. We'll do our best to help you!
71
77
 
72
78
  ## Source
73
79
 
74
- Problem 4 at Project Euler
75
-
76
- Wikipedia [http://projecteuler.net/problem=4](http://projecteuler.net/problem=4)
80
+ Problem 4 at Project Euler [http://projecteuler.net/problem=4](http://projecteuler.net/problem=4)
77
81
 
78
82
  ## Submitting Incomplete Solutions
79
83
  It's possible to submit an incomplete solution so you can see how others have completed the exercise.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trackler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1.98
4
+ version: 2.2.1.99
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katrina Owen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-21 00:00:00.000000000 Z
11
+ date: 2018-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -5182,6 +5182,12 @@ files:
5182
5182
  - tracks/fsharp/exercises/collatz-conjecture/Example.fs
5183
5183
  - tracks/fsharp/exercises/collatz-conjecture/Program.fs
5184
5184
  - tracks/fsharp/exercises/collatz-conjecture/README.md
5185
+ - tracks/fsharp/exercises/complex-numbers/ComplexNumbers.fs
5186
+ - tracks/fsharp/exercises/complex-numbers/ComplexNumbers.fsproj
5187
+ - tracks/fsharp/exercises/complex-numbers/ComplexNumbersTest.fs
5188
+ - tracks/fsharp/exercises/complex-numbers/Example.fs
5189
+ - tracks/fsharp/exercises/complex-numbers/Program.fs
5190
+ - tracks/fsharp/exercises/complex-numbers/README.md
5185
5191
  - tracks/fsharp/exercises/connect/Connect.fs
5186
5192
  - tracks/fsharp/exercises/connect/Connect.fsproj
5187
5193
  - tracks/fsharp/exercises/connect/ConnectTest.fs
@@ -6172,6 +6178,11 @@ files:
6172
6178
  - tracks/go/exercises/queen-attack/README.md
6173
6179
  - tracks/go/exercises/queen-attack/example.go
6174
6180
  - tracks/go/exercises/queen-attack/queen_attack_test.go
6181
+ - tracks/go/exercises/rail-fence-cipher/.meta/gen.go
6182
+ - tracks/go/exercises/rail-fence-cipher/README.md
6183
+ - tracks/go/exercises/rail-fence-cipher/cases_test.go
6184
+ - tracks/go/exercises/rail-fence-cipher/example.go
6185
+ - tracks/go/exercises/rail-fence-cipher/rail_fence_cipher_test.go
6175
6186
  - tracks/go/exercises/raindrops/.meta/gen.go
6176
6187
  - tracks/go/exercises/raindrops/.meta/hints.md
6177
6188
  - tracks/go/exercises/raindrops/README.md
@@ -7510,6 +7521,7 @@ files:
7510
7521
  - tracks/java/exercises/kindergarten-garden/src/main/java/Plant.java
7511
7522
  - tracks/java/exercises/kindergarten-garden/src/test/java/KindergartenGardenTest.java
7512
7523
  - tracks/java/exercises/largest-series-product/.meta/src/reference/java/LargestSeriesProductCalculator.java
7524
+ - tracks/java/exercises/largest-series-product/.meta/version
7513
7525
  - tracks/java/exercises/largest-series-product/README.md
7514
7526
  - tracks/java/exercises/largest-series-product/build.gradle
7515
7527
  - tracks/java/exercises/largest-series-product/src/main/java/LargestSeriesProductCalculator.java
@@ -9725,6 +9737,7 @@ files:
9725
9737
  - tracks/ocaml/exercises/forth/forth.mli
9726
9738
  - tracks/ocaml/exercises/forth/test.ml
9727
9739
  - tracks/ocaml/exercises/grade-school/.merlin
9740
+ - tracks/ocaml/exercises/grade-school/.meta/description.md
9728
9741
  - tracks/ocaml/exercises/grade-school/Makefile
9729
9742
  - tracks/ocaml/exercises/grade-school/README.md
9730
9743
  - tracks/ocaml/exercises/grade-school/example.ml
@@ -9792,6 +9805,7 @@ files:
9792
9805
  - tracks/ocaml/exercises/nucleotide-count/nucleotide_count.mli
9793
9806
  - tracks/ocaml/exercises/nucleotide-count/test.ml
9794
9807
  - tracks/ocaml/exercises/palindrome-products/.merlin
9808
+ - tracks/ocaml/exercises/palindrome-products/.meta/description.md
9795
9809
  - tracks/ocaml/exercises/palindrome-products/Makefile
9796
9810
  - tracks/ocaml/exercises/palindrome-products/README.md
9797
9811
  - tracks/ocaml/exercises/palindrome-products/example.ml