trackler 2.2.1.155 → 2.2.1.156

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +3 -0
  3. data/lib/trackler/version.rb +1 -1
  4. data/problem-specifications/exercises/simple-cipher/canonical-data.json +147 -0
  5. data/tracks/clojure/exercises/hexadecimal/src/hexadecimal.clj +5 -0
  6. data/tracks/clojure/exercises/isogram/src/isogram.clj +5 -0
  7. data/tracks/clojure/exercises/kindergarten-garden/src/kindergarten-garden.clj +5 -0
  8. data/tracks/csharp/exercises/list-ops/Example.cs +14 -9
  9. data/tracks/csharp/exercises/list-ops/ListOps.cs +4 -4
  10. data/tracks/csharp/exercises/list-ops/ListOpsTest.cs +90 -88
  11. data/tracks/csharp/exercises/zipper/Example.cs +51 -43
  12. data/tracks/csharp/exercises/zipper/Zipper.cs +16 -19
  13. data/tracks/csharp/exercises/zipper/ZipperTest.cs +94 -45
  14. data/tracks/csharp/generators/Exercises/ListOps.cs +123 -0
  15. data/tracks/csharp/generators/Exercises/Zipper.cs +107 -0
  16. data/tracks/csharp/generators/Output/ValueFormatter.cs +14 -0
  17. data/tracks/delphi/config.json +10 -1
  18. data/tracks/delphi/config/maintainers.json +11 -11
  19. data/tracks/elisp/config.json +8 -0
  20. data/tracks/elisp/exercises/run-length-encoding/README.md +36 -0
  21. data/tracks/elisp/exercises/run-length-encoding/example.el +62 -0
  22. data/tracks/elisp/exercises/run-length-encoding/run-length-encoding-test.el +61 -0
  23. data/tracks/elisp/exercises/run-length-encoding/run-length-encoding.el +9 -0
  24. data/tracks/fsharp/docs/LEARNING.md +3 -0
  25. data/tracks/java/exercises/armstrong-numbers/.meta/hints.md +2 -0
  26. data/tracks/java/exercises/armstrong-numbers/README.md +6 -0
  27. data/tracks/java/exercises/bracket-push/.meta/version +1 -1
  28. data/tracks/java/exercises/bracket-push/src/test/java/BracketCheckerTest.java +7 -0
  29. data/tracks/java/exercises/isbn-verifier/.meta/version +1 -1
  30. data/tracks/java/exercises/isbn-verifier/src/test/java/IsbnVerifierTest.java +12 -1
  31. data/tracks/java/exercises/kindergarten-garden/.meta/version +1 -1
  32. data/tracks/java/exercises/list-ops/.meta/version +1 -1
  33. data/tracks/java/exercises/list-ops/src/test/java/ListOpsTest.java +32 -1
  34. data/tracks/nim/config.json +13 -2
  35. data/tracks/nim/exercises/bob/bob_test.nim +1 -1
  36. data/tracks/nim/exercises/bob/example.nim +6 -3
  37. data/tracks/nim/exercises/bracket-push/README.md +11 -0
  38. data/tracks/nim/exercises/bracket-push/bracket_push_test.nim +52 -0
  39. data/tracks/nim/exercises/bracket-push/example.nim +22 -0
  40. data/tracks/ocaml/exercises/bracket-push/test.ml +3 -1
  41. data/tracks/ocaml/exercises/luhn/example.ml +8 -5
  42. data/tracks/ocaml/exercises/luhn/test.ml +3 -1
  43. data/tracks/powershell/.gitignore +2 -1
  44. data/tracks/powershell/config.json +46 -13
  45. data/tracks/powershell/exercises/bob/.version +1 -0
  46. data/tracks/powershell/exercises/bob/BobResponse.example.ps1 +28 -0
  47. data/tracks/powershell/exercises/bob/BobResponse.ps1 +8 -0
  48. data/tracks/powershell/exercises/bob/BobResponse.tests.ps1 +109 -0
  49. data/tracks/powershell/exercises/bob/README.md +20 -0
  50. data/tracks/powershell/exercises/nucleotide-count/.version +1 -0
  51. data/tracks/powershell/exercises/nucleotide-count/NucleotideCount.example.ps1 +36 -0
  52. data/tracks/powershell/exercises/nucleotide-count/NucleotideCount.ps1 +8 -0
  53. data/tracks/powershell/exercises/nucleotide-count/NucleotideCount.tests.ps1 +25 -0
  54. data/tracks/powershell/exercises/nucleotide-count/README.md +19 -0
  55. data/tracks/powershell/exercises/raindrops/.version +1 -0
  56. data/tracks/powershell/exercises/raindrops/README.md +24 -0
  57. data/tracks/powershell/exercises/raindrops/Raindrops.example.ps1 +32 -0
  58. data/tracks/powershell/exercises/raindrops/Raindrops.ps1 +8 -0
  59. data/tracks/powershell/exercises/raindrops/Raindrops.tests.ps1 +34 -0
  60. data/tracks/prolog/exercises/complex-numbers/complex_numbers_tests.plt +28 -29
  61. data/tracks/reasonml/.gitignore +4 -0
  62. data/tracks/reasonml/.travis.yml +5 -0
  63. data/tracks/reasonml/LICENSE +21 -0
  64. data/tracks/reasonml/README.md +67 -0
  65. data/tracks/reasonml/bin/fetch-configlet +32 -0
  66. data/tracks/reasonml/config.json +11 -0
  67. data/tracks/reasonml/config/exercise-readme-insert.md +0 -0
  68. data/tracks/reasonml/config/exercise_readme.go.tmpl +16 -0
  69. data/tracks/reasonml/config/maintainers.json +4 -0
  70. data/tracks/reasonml/docs/ABOUT.md +0 -0
  71. data/tracks/reasonml/docs/INSTALLATION.md +0 -0
  72. data/tracks/reasonml/docs/LEARNING.md +0 -0
  73. data/tracks/reasonml/docs/RESOURCES.md +0 -0
  74. data/tracks/reasonml/docs/TESTS.md +0 -0
  75. data/tracks/reasonml/img/.keep +0 -0
  76. data/tracks/scala/config.json +11 -0
  77. data/tracks/scala/exercises/armstrong-numbers/README.md +29 -0
  78. data/tracks/scala/exercises/armstrong-numbers/build.sbt +3 -0
  79. data/tracks/scala/exercises/armstrong-numbers/example.scala +7 -0
  80. data/tracks/scala/exercises/armstrong-numbers/src/main/scala/.keep +0 -0
  81. data/tracks/scala/exercises/armstrong-numbers/src/test/scala/ArmstrongNumbersTest.scala +44 -0
  82. data/tracks/scala/testgen/src/main/scala/ArmstrongNumbersTestGenerator.scala +33 -0
  83. data/tracks/scheme/config.json +8 -0
  84. data/tracks/scheme/exercises/atbash-cipher/README.md +36 -0
  85. data/tracks/scheme/exercises/atbash-cipher/atbash-cipher-test.scm +67 -0
  86. data/tracks/scheme/exercises/atbash-cipher/atbash-cipher.scm +8 -0
  87. data/tracks/scheme/exercises/atbash-cipher/example.scm +40 -0
  88. metadata +57 -3
  89. data/tracks/python/exercises/rna-transcription/.meta/hints.md +0 -1
@@ -16,3 +16,6 @@
16
16
  ### Books
17
17
  * [Beginning F# 4.0](https://books.google.nl/books?id=puQgDAAAQBAJ&redir_esc=y)
18
18
  * [Real-World Functional Programming](https://books.google.nl/books?id=KfooAQAAMAAJ&q=isbn:1933988924&dq=isbn:1933988924&hl=en&sa=X&ved=0ahUKEwj-4eCii43RAhWdYFAKHdmnAEIQ6AEIHDAA)
19
+
20
+ ### Misc
21
+ * The [F# mentorship program](https://fsharp.org/mentorship/about.html) offers free mentorship by very proficient F# users.
@@ -0,0 +1,2 @@
1
+ For more help on how to solve this exercise, please refer to the tutorial provided as part of the hello world exercise:
2
+ [TUTORIAL.md](https://github.com/exercism/java/blob/master/exercises/hello-world/TUTORIAL.md)
@@ -11,6 +11,12 @@ For example:
11
11
 
12
12
  Write some code to determine whether a number is an Armstrong number.
13
13
 
14
+ # Java Tips
15
+
16
+ For more help on how to solve this exercise, please refer to the tutorial provided as part of the hello world exercise:
17
+ [TUTORIAL.md](https://github.com/exercism/java/blob/master/exercises/hello-world/TUTORIAL.md)
18
+
19
+
14
20
  # Running the tests
15
21
 
16
22
  You can run all the tests for an exercise by entering
@@ -1 +1 @@
1
- 1.2.0
1
+ 1.3.0
@@ -47,6 +47,13 @@ public class BracketCheckerTest {
47
47
  assertTrue(bracketChecker.areBracketsMatchedAndNestedCorrectly());
48
48
  }
49
49
 
50
+ @Ignore("Remove to run test")
51
+ @Test
52
+ public void testPartiallyPairedBrackets() {
53
+ BracketChecker bracketChecker = new BracketChecker("{[])");
54
+ assertFalse(bracketChecker.areBracketsMatchedAndNestedCorrectly());
55
+ }
56
+
50
57
  @Ignore("Remove to run test")
51
58
  @Test
52
59
  public void testSimpleNestedBrackets() {
@@ -1 +1 @@
1
- 2.2.0
1
+ 2.5.0
@@ -40,7 +40,7 @@ public class IsbnVerifierTest {
40
40
  @Ignore("Remove to run test")
41
41
  @Test
42
42
  public void invalidCharacterInIsbn() {
43
- assertFalse(isbnVerifier.isValid("3-598-2K507-0"));
43
+ assertFalse(isbnVerifier.isValid("3-598-P1581-X"));
44
44
  }
45
45
 
46
46
  @Ignore("Remove to run test")
@@ -97,4 +97,15 @@ public class IsbnVerifierTest {
97
97
  assertFalse(isbnVerifier.isValid(""));
98
98
  }
99
99
 
100
+ @Ignore("Remove to run test")
101
+ @Test
102
+ public void inputIsNineCharacters() {
103
+ assertFalse(isbnVerifier.isValid("134456729"));
104
+ }
105
+
106
+ @Ignore("Remove to run test")
107
+ @Test
108
+ public void invalidCharactersAreNotIgnored() {
109
+ assertFalse(isbnVerifier.isValid("3132P34035"));
110
+ }
100
111
  }
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.1.1
@@ -1 +1 @@
1
- 2.2.0
1
+ 2.3.0
@@ -54,6 +54,37 @@ public class ListOpsTest {
54
54
  ListOps.concat(listOfLists));
55
55
  }
56
56
 
57
+ @Ignore("Remove to run test")
58
+ @Test
59
+ public void testConcatOnNonEmptyListOfNestedLists() {
60
+ List<List<List<Character>>> listOfNestedLists = Arrays.asList(
61
+ Arrays.asList(
62
+ Collections.singletonList('1'),
63
+ Collections.singletonList('2')
64
+ ),
65
+ Collections.singletonList(
66
+ Collections.singletonList('3')
67
+ ),
68
+ Collections.singletonList(
69
+ Collections.emptyList()
70
+ ),
71
+ Collections.singletonList(
72
+ Arrays.asList('4', '5', '6')
73
+ )
74
+ );
75
+
76
+ assertEquals(
77
+ Arrays.asList(
78
+ Collections.singletonList('1'),
79
+ Collections.singletonList('2'),
80
+ Collections.singletonList('3'),
81
+ Collections.emptyList(),
82
+ Arrays.asList('4', '5', '6')
83
+ ),
84
+ ListOps.concat(listOfNestedLists)
85
+ );
86
+ }
87
+
57
88
  @Ignore("Remove to run test")
58
89
  @Test
59
90
  public void testFilteringEmptyList() {
@@ -179,5 +210,5 @@ public class ListOpsTest {
179
210
  Arrays.asList('7', '5', '3', '1'),
180
211
  ListOps.reverse(Arrays.asList('1', '3', '5', '7')));
181
212
  }
182
-
213
+
183
214
  }
@@ -1,8 +1,6 @@
1
1
  {
2
2
  "language": "Nim",
3
- "checklist_issue": 13,
4
3
  "active": false,
5
- "foregone": [],
6
4
  "exercises": [
7
5
  {
8
6
  "uuid": "4817a6c0-6c9f-41ce-b53e-54ee3c0a6e40",
@@ -253,6 +251,19 @@
253
251
  "algorithms",
254
252
  "loops"
255
253
  ]
254
+ },
255
+ {
256
+ "uuid": "bb8af717-9e8d-498c-85cf-e6e77a84919e",
257
+ "slug": "bracket-push",
258
+ "core": false,
259
+ "unlocked_by": null,
260
+ "difficulty": 1,
261
+ "topics": [
262
+ "recursion",
263
+ "strings",
264
+ "stacks",
265
+ "parsing"
266
+ ]
256
267
  }
257
268
  ]
258
269
  }
@@ -29,7 +29,7 @@ suite "hey tests":
29
29
  check hey("It's OK if you don't want to go to the DMV.") == "Whatever."
30
30
 
31
31
  test "forceful questions":
32
- check hey("WHAT THE HELL WERE YOU THINKING?") == "Whoa, chill out!"
32
+ check hey("WHAT THE HELL WERE YOU THINKING?") == "Calm down, I know what I'm doing!"
33
33
 
34
34
  test "shouting numbers":
35
35
  check hey("1, 2, 3 GO!") == "Whoa, chill out!"
@@ -23,7 +23,7 @@ proc hey*(msg: string): string {.noSideEffect.} =
23
23
  ## Returns the response of a lackadaisical teenager to a futile attempt to
24
24
  ## communicate with him.
25
25
  ##
26
- ## .. code-block:: nimrod
26
+ ## .. code-block:: nim
27
27
  ## let greeting = "Hi, Bob!"
28
28
  ## assert hey(greeting) == "Whatever."
29
29
  ##
@@ -37,9 +37,12 @@ proc hey*(msg: string): string {.noSideEffect.} =
37
37
  ## assert hey(resignation) == "Fine. Be that way!"
38
38
  if isSilence(msg):
39
39
  return "Fine. Be that way!"
40
+ elif isQuestion(msg):
41
+ if isYelling(msg):
42
+ return "Calm down, I know what I'm doing!"
43
+ else:
44
+ return "Sure."
40
45
  elif isYelling(msg):
41
46
  return "Whoa, chill out!"
42
- elif isQuestion(msg):
43
- return "Sure."
44
47
  else:
45
48
  return "Whatever."
@@ -0,0 +1,11 @@
1
+ # Bracket Push
2
+
3
+ Given a string containing brackets `[]`, braces `{}`, parentheses `()`,
4
+ or any combination thereof, verify that any and all pairs are matched
5
+ and nested correctly.
6
+ ## Source
7
+
8
+ Ginna Baker
9
+
10
+ ## Submitting Incomplete Solutions
11
+ It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -0,0 +1,52 @@
1
+ import unittest
2
+
3
+ import bracket_push
4
+
5
+ suite "bracket-push":
6
+
7
+ test "paired square brackets":
8
+ check isPaired("[]") == true
9
+
10
+ test "empty string":
11
+ check isPaired("") == true
12
+
13
+ test "unpaired brackets":
14
+ check isPaired("[[") == false
15
+
16
+ test "wrong ordered brackets":
17
+ check isPaired("}{") == false
18
+
19
+ test "wrong closing bracket":
20
+ check isPaired("{]") == false
21
+
22
+ test "wrong closing bracket":
23
+ check isPaired("{ }") == true
24
+
25
+ test "wrong closing bracket":
26
+ check isPaired("{[])") == false
27
+
28
+ test "simple nested brackets":
29
+ check isPaired("{[]}") == true
30
+
31
+ test "several paired brackets":
32
+ check isPaired("{}[]") == true
33
+
34
+ test "paired and nested brackets":
35
+ check isPaired("([{}({}[])])") == true
36
+
37
+ test "unopened closing brackets":
38
+ check isPaired("{[)][]}") == false
39
+
40
+ test "unpaired and nested brackets":
41
+ check isPaired("([{])") == false
42
+
43
+ test "paired and wrong nested brackets":
44
+ check isPaired("[({]})") == false
45
+
46
+ test "math expression":
47
+ check isPaired("(((185 + 223.85) * 15) - 543)/2") == true
48
+
49
+ test "complex latex expression":
50
+ let value = "\\left(\\begin{array}{cc} \\frac{1}{3} & x\\\\ \\mathrm{e}^{x} &... x^2 \\end{array}\\right)"
51
+
52
+ check isPaired(value) == true
@@ -0,0 +1,22 @@
1
+ import
2
+ tables, deques, sequtils
3
+
4
+ const
5
+ lookupTable = {'(': ')', '{': '}', '[': ']'}.toTable
6
+
7
+ proc hasValue[A, B](t: Table[A, B], value: B): bool =
8
+ value in toSeq(t.values)
9
+
10
+ proc isPaired*(value: string): bool =
11
+ var stack = initDeque[char]()
12
+
13
+ for item in value:
14
+ if item in lookupTable:
15
+ stack.addLast(item)
16
+ if lookupTable.hasValue(item):
17
+ if len(stack) == 0:
18
+ return false
19
+ if lookupTable[stack.popLast()] != item:
20
+ return false
21
+
22
+ return len(stack) == 0
@@ -1,4 +1,4 @@
1
- (* Test/exercise version: "1.2.0" *)
1
+ (* Test/exercise version: "1.3.0" *)
2
2
 
3
3
  open Base
4
4
  open OUnit2
@@ -20,6 +20,8 @@ let tests = [
20
20
  ae false (are_balanced "{]");
21
21
  "paired with whitespace" >::
22
22
  ae true (are_balanced "{ }");
23
+ "partially paired brackets" >::
24
+ ae false (are_balanced "{[])");
23
25
  "simple nested brackets" >::
24
26
  ae true (are_balanced "{[]}");
25
27
  "several paired brackets" >::
@@ -8,9 +8,12 @@ let valid s =
8
8
  let s = String.filter s ~f:(fun ch -> Char.(ch <> ' ')) in
9
9
  if String.length s > 1
10
10
  then
11
- let checksum = String.to_list s
12
- |> List.rev_map ~f:(fun ch -> Char.to_int ch - Char.to_int '0')
13
- |> every_second_digit_doubled
14
- |> List.sum (module Int) ~f:Fn.id in
15
- checksum % 10 = 0
11
+ if String.exists s ~f:(Fn.non Char.is_digit)
12
+ then false
13
+ else
14
+ let checksum = String.to_list s
15
+ |> List.rev_map ~f:(fun ch -> Char.to_int ch - Char.to_int '0')
16
+ |> every_second_digit_doubled
17
+ |> List.sum (module Int) ~f:Fn.id in
18
+ checksum % 10 = 0
16
19
  else false
@@ -1,4 +1,4 @@
1
- (* Test/exercise version: "1.1.0" *)
1
+ (* Test/exercise version: "1.2.0" *)
2
2
 
3
3
  open Base
4
4
  open OUnit2
@@ -34,6 +34,8 @@ let tests = [
34
34
  assert_valid true "0000 0";
35
35
  "input digit 9 is correctly converted to output digit 9" >::
36
36
  assert_valid true "091";
37
+ "strings with non-digits is invalid" >::
38
+ assert_valid false ":9";
37
39
  ]
38
40
 
39
41
  let () =
@@ -1,9 +1,10 @@
1
1
  bin/configlet
2
2
  bin/configlet.exe
3
3
  exercises/hamming/hamming.ps1
4
+ *.sqlite-journal
4
5
  .vs/ProjectSettings.json
5
6
  .vs/slnx.sqlite
6
7
  .vs/VSWorkspaceState.json
7
8
  .vs/powershell/v15/.suo
8
9
  .vs/config/applicationhost.config
9
- .vs/*
10
+ .vs/*
@@ -2,7 +2,7 @@
2
2
  "slug": "powershell",
3
3
  "language": "Windows PowerShell",
4
4
  "repository": "https://github.com/exercism/powershell",
5
- "checklist_issue": 4,
5
+ "checklist_issue": "4",
6
6
  "active": false,
7
7
  "foregone": [
8
8
 
@@ -17,38 +17,71 @@
17
17
  "topics": [
18
18
  "strings"
19
19
  ]
20
- },
21
- {
20
+ }
21
+ ,{
22
22
  "uuid": "e62edbd6-861b-4cd6-bb03-6c9bcaa742a4",
23
23
  "slug": "leap",
24
24
  "core": false,
25
25
  "unlocked_by": null,
26
26
  "difficulty": 1,
27
27
  "topics": [
28
- "control_flow_if_else_statements",
29
- "integers"
28
+ "control_flow_if_else_statements"
29
+ ,"integers"
30
30
  ]
31
- },
32
- {
31
+ }
32
+ ,{
33
+ "uuid": "e80b254a-0dd8-4efb-83e4-cee1cfc9431e",
34
+ "slug": "bob",
35
+ "core": true,
36
+ "unlocked_by": null,
37
+ "difficulty": 1,
38
+ "topics": [
39
+ "control_flow_if_else_statements"
40
+ ,"strings"
41
+ ]
42
+ }
43
+ ,{
44
+ "uuid": "90a12652-946c-4771-83bd-741f884cd426",
45
+ "slug": "raindrops",
46
+ "core": true,
47
+ "unlocked_by": null,
48
+ "difficulty": 2,
49
+ "topics": [
50
+ "filtering"
51
+ ,"strings"
52
+ ]
53
+ }
54
+ ,{
33
55
  "uuid": "45f285c2-9358-451d-a931-1dee54df7b67",
34
56
  "slug": "two-fer",
35
57
  "core": false,
36
58
  "unlocked_by": null,
37
59
  "difficulty": 1,
38
60
  "topics": [
39
- "optional_values",
40
- "strings"
61
+ "optional_values"
62
+ ,"strings"
41
63
  ]
42
- },
43
- {
64
+ }
65
+ ,{
66
+ "uuid": "68b0b096-c6c0-493f-9f7f-081a413d7078",
67
+ "slug": "nucleotide-count",
68
+ "core": true,
69
+ "unlocked_by": null,
70
+ "difficulty": 2,
71
+ "topics": [
72
+ "dictionaries"
73
+ ,"strings"
74
+ ]
75
+ }
76
+ ,{
44
77
  "uuid": "f55b2158-a8f0-4593-b44a-6e750ebac0a5",
45
78
  "slug": "hamming",
46
79
  "core": false,
47
80
  "unlocked_by": null,
48
81
  "difficulty": 1,
49
82
  "topics": [
50
- "filtering",
51
- "strings"
83
+ "filtering"
84
+ ,"strings"
52
85
  ]
53
86
  }
54
87
  ]
@@ -0,0 +1,28 @@
1
+ Function Get-BobResponse() {
2
+ [CmdletBinding()]
3
+ Param(
4
+ [string]$HeyBob
5
+ )
6
+
7
+ # Clear whitespace around the input
8
+ $HeyBob = $HeyBob.Trim()
9
+
10
+ # The three types of input
11
+ $shouting = $false
12
+ $question = $false
13
+ $saidnothing = $false
14
+
15
+ # Tests for the types of input
16
+ If (($HeyBob.ToUpper() -ceq $HeyBob) -and ($HeyBob -cmatch "[A-Za-z]")) { $shouting = $true }
17
+ If ($HeyBob[$HeyBob.Length - 1] -eq "?") { $question = $true }
18
+ If ([string]::IsNullOrEmpty($HeyBob)) { $saidnothing = $true }
19
+
20
+ # Determine the output based on the results of the tests
21
+ If ($saidnothing) { Return "Fine. Be that way!" }
22
+ If ($question -and $shouting ) { Return "Calm down, I know what I'm doing!" }
23
+ If ($question) { Return "Sure." }
24
+ If ($shouting) { Return "Whoa, chill out!" }
25
+
26
+ # Default return value
27
+ Return "Whatever."
28
+ }