trackler 2.2.1.43 → 2.2.1.44

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/exercises/lens-person/description.md +1 -1
  4. data/problem-specifications/exercises/palindrome-products/description.md +5 -12
  5. data/problem-specifications/exercises/pascals-triangle/canonical-data.json +1 -7
  6. data/tracks/c/exercises/meetup/src/example.c +64 -60
  7. data/tracks/c/exercises/meetup/src/example.h +2 -2
  8. data/tracks/c/exercises/meetup/test/test_meetup.c +4 -4
  9. data/tracks/cfml/config.json +179 -169
  10. data/tracks/cfml/exercises/markdown/.meta/HINTS.md +0 -0
  11. data/tracks/cfml/exercises/markdown/Markdown.cfc +121 -0
  12. data/tracks/cfml/exercises/markdown/MarkdownTest.cfc +51 -0
  13. data/tracks/cfml/exercises/markdown/Solution.cfc +204 -0
  14. data/tracks/cfml/exercises/markdown/SolutionTest.cfc +7 -0
  15. data/tracks/cfml/exercises/markdown/TestRunner.cfc +103 -0
  16. data/tracks/cfml/exercises/markdown/box.json +8 -0
  17. data/tracks/cfml/exercises/markdown/index.cfm +37 -0
  18. data/tracks/csharp/exercises/dominoes/DominoesTest.cs +40 -45
  19. data/tracks/csharp/exercises/meetup/MeetupTest.cs +761 -83
  20. data/tracks/csharp/generators/Exercises/Dominoes.cs +33 -0
  21. data/tracks/csharp/generators/Exercises/Meetup.cs +46 -0
  22. data/tracks/csharp/generators/Output/FormattingExtensions.cs +11 -1
  23. data/tracks/csharp/generators/Output/TypesExtensions.cs +23 -0
  24. data/tracks/csharp/generators/Output/ValueFormatter.cs +70 -69
  25. data/tracks/dart/config.json +15 -3
  26. data/tracks/dart/exercises/word-count/README.md +18 -0
  27. data/tracks/dart/exercises/word-count/lib/example.dart +26 -0
  28. data/tracks/dart/exercises/word-count/lib/word_count.dart +3 -0
  29. data/tracks/dart/exercises/word-count/pubspec.lock +293 -0
  30. data/tracks/dart/exercises/word-count/pubspec.yaml +3 -0
  31. data/tracks/dart/exercises/word-count/test/word_count_test.dart +64 -0
  32. data/tracks/ecmascript/docs/INSTALLATION.md +4 -7
  33. data/tracks/elixir/exercises/hello-world/README.md +1 -26
  34. data/tracks/elixir/exercises/hello-world/example.exs +3 -7
  35. data/tracks/elixir/exercises/hello-world/hello_world.exs +3 -25
  36. data/tracks/elixir/exercises/hello-world/hello_world_test.exs +2 -13
  37. data/tracks/elixir/mix.lock +1 -1
  38. data/tracks/elm/config.json +11 -0
  39. data/tracks/elm/exercises/pascals-triangle/README.md +51 -0
  40. data/tracks/elm/exercises/pascals-triangle/Triangle.elm +1 -0
  41. data/tracks/elm/exercises/pascals-triangle/Triangle.example.elm +23 -0
  42. data/tracks/elm/exercises/pascals-triangle/elm-package.json +14 -0
  43. data/tracks/elm/exercises/pascals-triangle/package.json +14 -0
  44. data/tracks/elm/exercises/pascals-triangle/tests/Tests.elm +34 -0
  45. data/tracks/elm/exercises/pascals-triangle/tests/elm-package.json +16 -0
  46. data/tracks/fsharp/exercises/grade-school/GradeSchool.fs +2 -2
  47. data/tracks/fsharp/exercises/grade-school/GradeSchoolTest.fs +3 -2
  48. data/tracks/java/CONTRIBUTING.md +34 -0
  49. data/tracks/java/config.json +42 -6
  50. data/tracks/java/exercises/largest-series-product/src/main/java/LargestSeriesProductCalculator.java +7 -3
  51. data/tracks/java/exercises/matrix/src/main/java/Matrix.java +23 -0
  52. data/tracks/julia/config.json +11 -2
  53. data/tracks/julia/exercises/grains/README.md +33 -0
  54. data/tracks/julia/exercises/grains/example.jl +23 -0
  55. data/tracks/julia/exercises/grains/grains.jl +9 -0
  56. data/tracks/julia/exercises/grains/runtests.jl +27 -0
  57. data/tracks/lua/README.md +1 -1
  58. data/tracks/mips/exercises/octal/README.md +3 -8
  59. data/tracks/ocaml/exercises/palindrome-products/README.md +8 -14
  60. data/tracks/perl6/.travis.yml +7 -3
  61. data/tracks/perl6/bin/exercise-gen.pl6 +5 -1
  62. data/tracks/perl6/exercises/accumulate/README.md +0 -3
  63. data/tracks/perl6/exercises/accumulate/accumulate.t +9 -3
  64. data/tracks/perl6/exercises/all-your-base/README.md +1 -1
  65. data/tracks/perl6/exercises/all-your-base/all-your-base.t +23 -11
  66. data/tracks/perl6/exercises/all-your-base/example.yaml +1 -1
  67. data/tracks/perl6/exercises/allergies/README.md +0 -1
  68. data/tracks/perl6/exercises/allergies/allergies.t +22 -10
  69. data/tracks/perl6/exercises/anagram/anagram.t +22 -10
  70. data/tracks/perl6/exercises/atbash-cipher/README.md +2 -1
  71. data/tracks/perl6/exercises/atbash-cipher/atbash-cipher.t +22 -10
  72. data/tracks/perl6/exercises/binary/README.md +2 -0
  73. data/tracks/perl6/exercises/bob/bob.t +24 -11
  74. data/tracks/perl6/exercises/bob/example.yaml +2 -2
  75. data/tracks/perl6/exercises/clock/clock.t +22 -10
  76. data/tracks/perl6/exercises/flatten-array/README.md +1 -2
  77. data/tracks/perl6/exercises/flatten-array/example.yaml +1 -1
  78. data/tracks/perl6/exercises/flatten-array/flatten-array.t +23 -11
  79. data/tracks/perl6/exercises/grade-school/README.md +0 -1
  80. data/tracks/perl6/exercises/grade-school/grade-school.t +9 -3
  81. data/tracks/perl6/exercises/grains/README.md +0 -1
  82. data/tracks/perl6/exercises/grains/grains.t +22 -10
  83. data/tracks/perl6/exercises/hello-world/example.yaml +3 -3
  84. data/tracks/perl6/exercises/hello-world/hello-world.t +25 -12
  85. data/tracks/perl6/exercises/leap/README.md +1 -1
  86. data/tracks/perl6/exercises/leap/example.yaml +1 -1
  87. data/tracks/perl6/exercises/leap/leap.t +23 -11
  88. data/tracks/perl6/exercises/linked-list/README.md +10 -10
  89. data/tracks/perl6/exercises/linked-list/linked-list.t +9 -3
  90. data/tracks/perl6/exercises/luhn/README.md +7 -7
  91. data/tracks/perl6/exercises/luhn/luhn.t +22 -10
  92. data/tracks/perl6/exercises/phone-number/README.md +3 -2
  93. data/tracks/perl6/exercises/phone-number/phone-number.t +22 -10
  94. data/tracks/perl6/exercises/raindrops/raindrops.t +22 -10
  95. data/tracks/perl6/exercises/rna-transcription/rna-transcription.t +22 -10
  96. data/tracks/perl6/exercises/robot-name/robot-name.t +9 -3
  97. data/tracks/perl6/exercises/scrabble-score/README.md +3 -1
  98. data/tracks/perl6/exercises/scrabble-score/scrabble-score.t +22 -10
  99. data/tracks/perl6/exercises/space-age/README.md +2 -1
  100. data/tracks/perl6/exercises/space-age/space-age.t +22 -10
  101. data/tracks/perl6/exercises/trinary/README.md +1 -1
  102. data/tracks/perl6/exercises/word-count/README.md +1 -2
  103. data/tracks/perl6/exercises/word-count/word-count.t +22 -10
  104. data/tracks/perl6/exercises/wordy/README.md +0 -5
  105. data/tracks/perl6/exercises/wordy/wordy.t +22 -10
  106. data/tracks/perl6/templates/test.mustache +26 -15
  107. data/tracks/python/config.json +10 -0
  108. data/tracks/python/exercises/book-store/book_store.py +1 -1
  109. data/tracks/python/exercises/flatten-array/flatten_array.py +1 -1
  110. data/tracks/python/exercises/matrix/matrix.py +1 -1
  111. data/tracks/python/exercises/palindrome-products/palindrome_products.py +2 -2
  112. data/tracks/python/exercises/perfect-numbers/perfect_numbers.py +2 -2
  113. data/tracks/python/exercises/pythagorean-triplet/pythagorean_triplet.py +3 -3
  114. data/tracks/python/exercises/raindrops/raindrops.py +1 -1
  115. data/tracks/python/exercises/scale-generator/scale_generator.py +1 -1
  116. data/tracks/python/exercises/sieve/sieve.py +1 -1
  117. data/tracks/python/exercises/sublist/sublist.py +1 -1
  118. data/tracks/python/exercises/transpose/transpose.py +1 -1
  119. data/tracks/python/exercises/triangle/triangle.py +4 -1
  120. data/tracks/python/exercises/two-bucket/example.py +59 -0
  121. data/tracks/python/exercises/two-bucket/two_bucket.py +2 -0
  122. data/tracks/python/exercises/two-bucket/two_bucket_test.py +32 -0
  123. data/tracks/scheme/config.json +59 -89
  124. data/tracks/scheme/config/maintainers.json +11 -11
  125. data/tracks/sml/exercises/allergies/README.md +20 -5
  126. data/tracks/sml/exercises/allergies/allergies.sml +11 -14
  127. data/tracks/sml/exercises/allergies/example.sml +9 -9
  128. data/tracks/sml/exercises/allergies/test.sml +65 -129
  129. data/tracks/sml/exercises/allergies/testlib.sml +159 -0
  130. data/tracks/sml/exercises/hamming/README.md +21 -5
  131. data/tracks/sml/exercises/hamming/example.sml +14 -10
  132. data/tracks/sml/exercises/hamming/hamming.sml +4 -3
  133. data/tracks/sml/exercises/hamming/test.sml +55 -64
  134. data/tracks/sml/exercises/hamming/testlib.sml +159 -0
  135. data/tracks/typescript/config.json +15 -0
  136. data/tracks/typescript/exercises/linked-list/linked-list.test.ts +11 -11
  137. data/tracks/typescript/exercises/nth-prime/README.md +36 -0
  138. data/tracks/typescript/exercises/nth-prime/nth-prime.example.ts +28 -0
  139. data/tracks/typescript/exercises/nth-prime/nth-prime.test.ts +25 -0
  140. data/tracks/typescript/exercises/nth-prime/nth-prime.ts +0 -0
  141. data/tracks/typescript/exercises/nth-prime/package.json +36 -0
  142. data/tracks/typescript/exercises/nth-prime/tsconfig.json +22 -0
  143. data/tracks/typescript/exercises/nth-prime/tslint.json +127 -0
  144. data/tracks/typescript/exercises/nth-prime/yarn.lock +2305 -0
  145. data/tracks/typescript/exercises/prime-factors/README.md +1 -1
  146. data/tracks/typescript/exercises/prime-factors/prime-factors.test.ts +11 -11
  147. data/tracks/typescript/exercises/series/README.md +1 -1
  148. data/tracks/typescript/exercises/series/series.test.ts +11 -11
  149. data/tracks/typescript/img/icon.png +0 -0
  150. data/tracks/typescript/img/icon.svg +3 -8
  151. metadata +44 -2
@@ -1,10 +1,14 @@
1
- exception NonEqualLengthStringsFound;
2
- fun hamming (s1, s2) = let
3
- val chars1 = explode s1
4
- val chars2 = explode s2
5
- fun hamming' ([],[]) acc = acc
6
- | hamming' ((x::xs),(y::ys)) acc = hamming' (xs, ys) (acc + (if x = y then 0 else 1))
7
- in
8
- if (length chars1) <> (length chars2) then raise NonEqualLengthStringsFound
9
- else hamming' (chars1, chars2) 0
10
- end
1
+ exception NonEqualLengthStringsFound
2
+
3
+ fun distance (strand1: string, strand2: string): int =
4
+ let
5
+ val chars1 = explode strand1
6
+ val chars2 = explode strand2
7
+ fun distance' ([], []) acc = acc
8
+ | distance' ((x::xs), (y::ys)) acc =
9
+ distance' (xs, ys) (acc + (if x = y then 0 else 1))
10
+ in
11
+ if (length chars1) <> (length chars2) then
12
+ raise NonEqualLengthStringsFound
13
+ else distance' (chars1, chars2) 0
14
+ end
@@ -1,3 +1,4 @@
1
- exception NonEqualLengthStringsFound;
2
- fun hamming (s1: string, s2: string): int =
3
- raise Fail "'hamming' has not been implemented"
1
+ exception NonEqualLengthStringsFound
2
+
3
+ fun distance (strand1: string, strand2: string): int =
4
+ raise Fail "'distance' is not implemented"
@@ -1,66 +1,57 @@
1
+ (* version 2.0.0 *)
2
+
3
+ use "testlib.sml";
1
4
  use "hamming.sml";
2
5
 
3
- val test_cases = [
4
- {
5
- description = "'GAGCCTACTAACGGGAT' is 7 away from 'CATCGTAATGACGGCCT'",
6
- input = ("GAGCCTACTAACGGGAT","CATCGTAATGACGGCCT"),
7
- expected = 7
8
- },
9
- {
10
- description = "'CAT' is 3 away from 'DOG'",
11
- input = ("CAT","DOG"),
12
- expected = 3
13
- },
14
- {
15
- description = "'DEPOSIT' is 4 away from 'DOPIEST'",
16
- input = ("DEPOSIT","DOPIEST"),
17
- expected = 4
18
- }
19
- ];
20
-
21
- val error_test_cases = [
22
- {
23
- description = "throws error on unequal length strings",
24
- input = ("", "A"),
25
- expected = NonEqualLengthStringsFound
26
- },
27
- {
28
- description = "throws error on unequal length strings",
29
- input = ("A", ""),
30
- expected = NonEqualLengthStringsFound
31
- },
32
- {
33
- description = "throws error on unequal length strings",
34
- input = ("ABCD", "ABC"),
35
- expected = NonEqualLengthStringsFound
36
- }
37
- ];
38
-
39
- fun run_tests _ [] = []
40
- | run_tests f (x :: xs) =
41
- let
42
- fun aux { description, is_correct } =
43
- let
44
- val expl = description ^ ": " ^
45
- (if is_correct then "PASSED" else "FAILED") ^ "\n"
46
- in
47
- (print (expl); is_correct)
48
- end
49
- in
50
- (aux x) :: run_tests f xs
51
- end
52
-
53
- fun evaluateGoodTestCase f { description, input, expected } =
54
- { description = description, is_correct = (f input) = expected }
55
-
56
- fun evaluateErrorTestCase f { description, input, expected } =
57
- { description = description, is_correct = (f input handle expected => 1) = 1 }
58
-
59
- val testResults = run_tests hamming (List.map (evaluateGoodTestCase hamming) test_cases)
60
- @ run_tests hamming (List.map (evaluateErrorTestCase hamming) error_test_cases);
61
- val passedTests = List.filter (fn x => x) testResults;
62
- val failedTests = List.filter (fn x => not x) testResults;
63
-
64
- if (List.length testResults) = (List.length passedTests)
65
- then (print "ALL TESTS PASSED")
66
- else (print (Int.toString (List.length failedTests) ^ " TEST(S) FAILED"));
6
+ infixr |>
7
+ fun x |> f = f x
8
+
9
+ val testsuite =
10
+ describe "hamming" [
11
+ test "empty strands"
12
+ (fn _ => distance ("", "") |> Expect.equalTo 0),
13
+
14
+ test "identical strands"
15
+ (fn _ => distance ("A", "A") |> Expect.equalTo 0),
16
+
17
+ test "long identical strands"
18
+ (fn _ => distance ("GGACTGA", "GGACTGA") |> Expect.equalTo 0),
19
+
20
+ test "complete distance in single nucleotide strands"
21
+ (fn _ => distance ("A", "G") |> Expect.equalTo 1),
22
+
23
+ test "complete distance in small strands"
24
+ (fn _ => distance ("AG", "CT") |> Expect.equalTo 2),
25
+
26
+ test "small distance in small strands"
27
+ (fn _ => distance ("AT", "CT") |> Expect.equalTo 1),
28
+
29
+ test "small distance"
30
+ (fn _ => distance ("GGACG", "GGTCG") |> Expect.equalTo 1),
31
+
32
+ test "small distance in long strands"
33
+ (fn _ => distance ("ACCAGGG", "ACTATGG") |> Expect.equalTo 2),
34
+
35
+ test "non-unique character in first strand"
36
+ (fn _ => distance ("AGA", "AGG") |> Expect.equalTo 1),
37
+
38
+ test "non-unique character in second strand"
39
+ (fn _ => distance ("AGG", "AGA") |> Expect.equalTo 1),
40
+
41
+ test "same nucleotides in different positions"
42
+ (fn _ => distance ("TAG", "GAT") |> Expect.equalTo 2),
43
+
44
+ test "large distance"
45
+ (fn _ => distance ("GATACA", "GCATAA") |> Expect.equalTo 4),
46
+
47
+ test "large distance in off-by-one strand"
48
+ (fn _ => distance ("GGACGGATTCTG", "AGGACGGATTCT") |> Expect.equalTo 9),
49
+
50
+ test "disallow first strand longer"
51
+ (fn _ => (fn _ => distance ("AATG", "AAA")) |> Expect.error NonEqualLengthStringsFound),
52
+
53
+ test "disallow second strand longer"
54
+ (fn _ => (fn _ => distance ("ATA", "AGTG")) |> Expect.error NonEqualLengthStringsFound)
55
+ ]
56
+
57
+ val _ = Test.run testsuite
@@ -0,0 +1,159 @@
1
+ structure Expect =
2
+ struct
3
+ datatype expectation = Pass | Fail of string * string
4
+
5
+ local
6
+ fun failEq b a =
7
+ Fail ("Expected: " ^ b, "Got: " ^ a)
8
+
9
+ fun failExn b a =
10
+ Fail ("Expected: " ^ b, "Raised: " ^ a)
11
+
12
+ fun exnName (e: exn): string = General.exnName e
13
+ in
14
+ fun truthy a =
15
+ if a
16
+ then Pass
17
+ else failEq "true" "false"
18
+
19
+ fun falsy a =
20
+ if a
21
+ then failEq "false" "true"
22
+ else Pass
23
+
24
+ fun equalTo b a =
25
+ if a = b
26
+ then Pass
27
+ else failEq (PolyML.makestring b) (PolyML.makestring a)
28
+
29
+ fun nearTo b a =
30
+ if Real.== (a, b)
31
+ then Pass
32
+ else failEq (Real.toString b) (Real.toString a)
33
+
34
+ fun anyError f =
35
+ (
36
+ f ();
37
+ failExn "an exception" "Nothing"
38
+ ) handle _ => Pass
39
+
40
+ fun error e f =
41
+ (
42
+ f ();
43
+ failExn (exnName e) "Nothing"
44
+ ) handle e' => if exnMessage e' = exnMessage e
45
+ then Pass
46
+ else failExn (exnMessage e) (exnMessage e')
47
+ end
48
+ end
49
+
50
+ structure TermColor =
51
+ struct
52
+ datatype color = Red | Green | Yellow | Normal
53
+
54
+ fun f Red = "\027[31m"
55
+ | f Green = "\027[32m"
56
+ | f Yellow = "\027[33m"
57
+ | f Normal = "\027[0m"
58
+
59
+ fun colorize color s = (f color) ^ s ^ (f Normal)
60
+
61
+ val redit = colorize Red
62
+
63
+ val greenit = colorize Green
64
+
65
+ val yellowit = colorize Yellow
66
+ end
67
+
68
+ structure Test =
69
+ struct
70
+ datatype testnode = TestGroup of string * testnode list
71
+ | Test of string * (unit -> Expect.expectation)
72
+
73
+ local
74
+ datatype evaluation = Success of string
75
+ | Failure of string * string * string
76
+ | Error of string * string
77
+
78
+ fun indent n s = (implode (List.tabulate (n, fn _ => #" "))) ^ s
79
+
80
+ fun fmt indentlvl ev =
81
+ let
82
+ val check = TermColor.greenit "\226\156\148 " (* ✔ *)
83
+ val cross = TermColor.redit "\226\156\150 " (* ✖ *)
84
+ val indentlvl = indentlvl * 2
85
+ in
86
+ case ev of
87
+ Success descr => indent indentlvl (check ^ descr)
88
+ | Failure (descr, exp, got) =>
89
+ String.concatWith "\n" [indent indentlvl (cross ^ descr),
90
+ indent (indentlvl + 2) exp,
91
+ indent (indentlvl + 2) got]
92
+ | Error (descr, reason) =>
93
+ String.concatWith "\n" [indent indentlvl (cross ^ descr),
94
+ indent (indentlvl + 2) (TermColor.redit reason)]
95
+ end
96
+
97
+ fun eval (TestGroup _) = raise Fail "Only a 'Test' can be evaluated"
98
+ | eval (Test (descr, thunk)) =
99
+ (
100
+ case thunk () of
101
+ Expect.Pass => ((1, 0, 0), Success descr)
102
+ | Expect.Fail (s, s') => ((0, 1, 0), Failure (descr, s, s'))
103
+ )
104
+ handle e => ((0, 0, 1), Error (descr, "Unexpected error: " ^ exnMessage e))
105
+
106
+ fun flatten depth testnode =
107
+ let
108
+ fun sum (x, y, z) (a, b, c) = (x + a, y + b, z + c)
109
+
110
+ fun aux (t, (counter, acc)) =
111
+ let
112
+ val (counter', texts) = flatten (depth + 1) t
113
+ in
114
+ (sum counter' counter, texts :: acc)
115
+ end
116
+ in
117
+ case testnode of
118
+ TestGroup (descr, ts) =>
119
+ let
120
+ val (counter, texts) = foldr aux ((0, 0, 0), []) ts
121
+ in
122
+ (counter, (indent (depth * 2) descr) :: List.concat texts)
123
+ end
124
+ | Test _ =>
125
+ let
126
+ val (counter, evaluation) = eval testnode
127
+ in
128
+ (counter, [fmt depth evaluation])
129
+ end
130
+ end
131
+
132
+ fun println s = print (s ^ "\n")
133
+ in
134
+ fun run suite =
135
+ let
136
+ val ((succeeded, failed, errored), texts) = flatten 0 suite
137
+
138
+ val summary = String.concatWith ", " [
139
+ TermColor.greenit ((Int.toString succeeded) ^ " passed"),
140
+ TermColor.redit ((Int.toString failed) ^ " failed"),
141
+ TermColor.redit ((Int.toString errored) ^ " errored"),
142
+ (Int.toString (succeeded + failed + errored)) ^ " total"
143
+ ]
144
+
145
+ val status = if failed = 0 andalso errored = 0
146
+ then OS.Process.success
147
+ else OS.Process.failure
148
+
149
+ in
150
+ List.app println texts;
151
+ println "";
152
+ println ("Tests: " ^ summary);
153
+ OS.Process.exit status
154
+ end
155
+ end
156
+ end
157
+
158
+ fun describe description tests = Test.TestGroup (description, tests)
159
+ fun test description thunk = Test.Test (description, thunk)
@@ -90,6 +90,21 @@
90
90
  "Integers"
91
91
  ]
92
92
  },
93
+ {
94
+ "uuid": "4c1392d7-8779-496f-b0bb-81605e777e3b",
95
+ "slug": "nth-prime",
96
+ "core": false,
97
+ "unlocked_by": "prime-factors",
98
+ "difficulty": 5,
99
+ "topics": [
100
+ "Control-flow (conditionals)",
101
+ "Control-flow (loops)",
102
+ "Exception handling",
103
+ "Algorithms",
104
+ "Mathematics",
105
+ "Integers"
106
+ ]
107
+ },
93
108
  {
94
109
  "uuid": "e431fb10-766a-4542-94ad-9c30224a3885",
95
110
  "slug": "sum-of-multiples",
@@ -1,7 +1,7 @@
1
1
  import LinkedList from './linked-list'
2
2
 
3
3
  describe('LinkedList', () => {
4
- test('add/extract elements to the end of the list with push/pop', () => {
4
+ it('add/extract elements to the end of the list with push/pop', () => {
5
5
  const list = new LinkedList<number>()
6
6
  list.push(10)
7
7
  list.push(20)
@@ -9,7 +9,7 @@ describe('LinkedList', () => {
9
9
  expect(list.pop()).toBe(10)
10
10
  })
11
11
 
12
- xtest('extract elements from the beginning of the list with shift', () => {
12
+ xit('extract elements from the beginning of the list with shift', () => {
13
13
  const list = new LinkedList<number>()
14
14
  list.push(10)
15
15
  list.push(20)
@@ -17,7 +17,7 @@ describe('LinkedList', () => {
17
17
  expect(list.shift()).toBe(20)
18
18
  })
19
19
 
20
- xtest('add/extract elements from the beginning of the list with unshift/shift', () => {
20
+ xit('add/extract elements from the beginning of the list with unshift/shift', () => {
21
21
  const list = new LinkedList<number>()
22
22
  list.unshift(10)
23
23
  list.unshift(20)
@@ -25,7 +25,7 @@ describe('LinkedList', () => {
25
25
  expect(list.shift()).toBe(10)
26
26
  })
27
27
 
28
- xtest('unshift/pop', () => {
28
+ xit('unshift/pop', () => {
29
29
  const list = new LinkedList<number>()
30
30
  list.unshift(10)
31
31
  list.unshift(20)
@@ -33,7 +33,7 @@ describe('LinkedList', () => {
33
33
  expect(list.pop()).toBe(20)
34
34
  })
35
35
 
36
- xtest('example', () => {
36
+ xit('example', () => {
37
37
  const list = new LinkedList<number>()
38
38
  list.push(10)
39
39
  list.push(20)
@@ -47,7 +47,7 @@ describe('LinkedList', () => {
47
47
  expect(list.shift()).toBe(30)
48
48
  })
49
49
 
50
- xtest('can count its elements', () => {
50
+ xit('can count its elements', () => {
51
51
  const list = new LinkedList<number>()
52
52
  expect(list.count()).toBe(0)
53
53
  list.push(10)
@@ -56,7 +56,7 @@ describe('LinkedList', () => {
56
56
  expect(list.count()).toBe(2)
57
57
  })
58
58
 
59
- xtest('sets head/tail after popping last element', () => {
59
+ xit('sets head/tail after popping last element', () => {
60
60
  const list = new LinkedList<number>()
61
61
  list.push(10)
62
62
  list.pop()
@@ -65,7 +65,7 @@ describe('LinkedList', () => {
65
65
  expect(list.pop()).toBe(20)
66
66
  })
67
67
 
68
- xtest('sets head/tail after shifting last element', () => {
68
+ xit('sets head/tail after shifting last element', () => {
69
69
  const list = new LinkedList<number>()
70
70
  list.unshift(10)
71
71
  list.shift()
@@ -74,7 +74,7 @@ describe('LinkedList', () => {
74
74
  expect(list.shift()).toBe(20)
75
75
  })
76
76
 
77
- xtest('deletes the element with the specified value from the list', () => {
77
+ xit('deletes the element with the specified value from the list', () => {
78
78
  const list = new LinkedList<number>()
79
79
  list.push(10)
80
80
  list.push(20)
@@ -85,14 +85,14 @@ describe('LinkedList', () => {
85
85
  expect(list.shift()).toBe(10)
86
86
  })
87
87
 
88
- xtest('deletes the only element', () => {
88
+ xit('deletes the only element', () => {
89
89
  const list = new LinkedList<number>()
90
90
  list.push(10)
91
91
  list.delete(10)
92
92
  expect(list.count()).toBe(0)
93
93
  })
94
94
 
95
- xtest('delete does not modify the list if the element is not found', () => {
95
+ xit('delete does not modify the list if the element is not found', () => {
96
96
  const list = new LinkedList<number>()
97
97
  list.push(10)
98
98
  list.delete(20)
@@ -0,0 +1,36 @@
1
+ # Nth Prime
2
+
3
+ Given a number n, determine what the nth prime is.
4
+
5
+ By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that
6
+ the 6th prime is 13.
7
+
8
+ If your language provides methods in the standard library to deal with prime
9
+ numbers, pretend they don't exist and implement them yourself.
10
+
11
+
12
+ ## Setup
13
+
14
+ Go through the setup instructions for TypeScript to
15
+ install the necessary dependencies:
16
+
17
+ http://exercism.io/languages/typescript
18
+
19
+ ## Requirements
20
+
21
+ Install assignment dependencies:
22
+
23
+ ```bash
24
+ $ yarn install
25
+ ```
26
+
27
+ ## Making the test suite pass
28
+
29
+ Execute the tests with:
30
+
31
+ ```bash
32
+ $ yarn test
33
+ ```
34
+
35
+ ## Submitting Incomplete Solutions
36
+ It's possible to submit an incomplete solution so you can see how others have completed the exercise.