trackler 2.2.1.14 → 2.2.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/tracks/c/docs/INSTALLATION.md +1 -1
- data/tracks/csharp/exercises/binary-search/BinarySearchTest.cs +2 -2
- data/tracks/csharp/exercises/poker/Example.cs +69 -20
- data/tracks/csharp/exercises/poker/PokerTest.cs +152 -82
- data/tracks/csharp/exercises/raindrops/RaindropsTest.cs +4 -4
- data/tracks/csharp/exercises/roman-numerals/RomanNumeralsTest.cs +4 -4
- data/tracks/csharp/exercises/word-count/Example.cs +2 -2
- data/tracks/csharp/exercises/word-count/WordCount.cs +2 -2
- data/tracks/csharp/exercises/word-count/WordCountTest.cs +85 -87
- data/tracks/csharp/generators/Exercises/Pangram.cs +0 -1
- data/tracks/csharp/generators/Exercises/Poker.cs +19 -0
- data/tracks/csharp/generators/Exercises/RomanNumerals.cs +0 -1
- data/tracks/csharp/generators/Exercises/WordCount.cs +27 -0
- data/tracks/csharp/generators/Output/NameExtensions.cs +6 -4
- data/tracks/delphi/{docs → exercises/hello-world}/GETTING_STARTED_GUIDE.md +0 -0
- data/tracks/go/config.json +629 -618
- data/tracks/go/config/maintainers.json +33 -33
- data/tracks/go/exercises/accumulate/README.md +0 -3
- data/tracks/go/exercises/hello-world/example.go +0 -2
- data/tracks/go/exercises/hello-world/hello_test.go +0 -20
- data/tracks/go/exercises/hello-world/hello_world.go +1 -36
- data/tracks/go/exercises/leap/leap.go +0 -1
- data/tracks/go/exercises/leap/leap_test.go +7 -3
- data/tracks/go/exercises/two-fer/README.md +66 -0
- data/tracks/go/exercises/two-fer/example.go +9 -0
- data/tracks/go/exercises/{hello-world/example_helloworld_test.go → two-fer/example_two_fer_test.go} +9 -9
- data/tracks/go/exercises/two-fer/two_fer.go +15 -0
- data/tracks/go/exercises/two-fer/two_fer_test.go +20 -0
- data/tracks/go/gen/gen.go +11 -10
- data/tracks/python/exercises/change/change_test.py +7 -2
- data/tracks/rust/config.json +1 -0
- data/tracks/rust/docs/ABOUT.md +1 -1
- data/tracks/scala/exercises/nth-prime/example.scala +2 -2
- data/tracks/scala/exercises/nth-prime/src/test/scala/NthPrimeTest.scala +29 -0
- data/tracks/scala/testgen/src/main/scala/NthPrimeTestGenerator.scala +34 -0
- metadata +12 -7
- data/tracks/fsharp/appveyor.yml +0 -4
- data/tracks/fsharp/circle.yml +0 -16
- data/tracks/scala/exercises/nth-prime/src/test/scala/PrimeTest.scala +0 -37
@@ -19,13 +19,18 @@ class ChangeTest(unittest.TestCase):
|
|
19
19
|
[21, 21, 21])
|
20
20
|
|
21
21
|
def test_large_target_values(self):
|
22
|
-
self.assertEqual(find_minimum_coins(
|
23
|
-
[2, 2,
|
22
|
+
self.assertEqual(find_minimum_coins(999, [1, 2, 5, 10, 20, 50, 100]),
|
23
|
+
[2, 2, 5, 20, 20, 50, 100, 100, 100,
|
24
|
+
100, 100, 100, 100, 100, 100])
|
24
25
|
|
25
26
|
def test_possible_change_without_unit_coins_available(self):
|
26
27
|
self.assertEqual(find_minimum_coins(21, [2, 5, 10, 20, 50]),
|
27
28
|
[2, 2, 2, 5, 10])
|
28
29
|
|
30
|
+
def test_another_possible_change_without_unit_coins_available(self):
|
31
|
+
self.assertEqual(find_minimum_coins(27, [4, 5]),
|
32
|
+
[4, 4, 4, 5, 5, 5])
|
33
|
+
|
29
34
|
def test_no_coins_make_0_change(self):
|
30
35
|
self.assertEqual(find_minimum_coins(0, [1, 5, 10, 21, 25]), [])
|
31
36
|
|
data/tracks/rust/config.json
CHANGED
data/tracks/rust/docs/ABOUT.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Rust
|
1
|
+
Rust aims to bring modern language design and an advanced type system to systems programming. Rust does not use a garbage collector, but instead ensures safety and optimizes code at compile time. The concept of [ownership](https://doc.rust-lang.org/book/ownership.html) is how Rust achieves its largest goal, memory safety.
|
2
2
|
|
3
3
|
Rust core and the standard library contain a minimal set of functionality. Rustaceans are encouraged to add features, in the form of libraries called _crates_, to the language and then share them on [crates.io](https://crates.io/).
|
4
4
|
|
@@ -1,10 +1,10 @@
|
|
1
|
-
object
|
1
|
+
object NthPrime {
|
2
2
|
// The stream will cache calculated primes. This is nice for performance,
|
3
3
|
// but not so nice for memory utilization.
|
4
4
|
private lazy val primes: Stream[BigInt] =
|
5
5
|
Stream.cons(BigInt(2), primes.map(b => new BigInt(b.bigInteger.nextProbablePrime)))
|
6
6
|
|
7
|
-
def
|
7
|
+
def prime(n: Int): Option[Int] =
|
8
8
|
if (n < 1) None
|
9
9
|
else Some(primes.drop(n - 1).head.toInt)
|
10
10
|
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import org.scalatest.{Matchers, FunSuite}
|
2
|
+
|
3
|
+
/** @version 1.0.0 */
|
4
|
+
class NthPrimeTest extends FunSuite with Matchers {
|
5
|
+
|
6
|
+
test("first prime") {
|
7
|
+
NthPrime.prime(1) should be (Some(2))
|
8
|
+
}
|
9
|
+
|
10
|
+
test("second prime") {
|
11
|
+
pending
|
12
|
+
NthPrime.prime(2) should be (Some(3))
|
13
|
+
}
|
14
|
+
|
15
|
+
test("sixth prime") {
|
16
|
+
pending
|
17
|
+
NthPrime.prime(6) should be (Some(13))
|
18
|
+
}
|
19
|
+
|
20
|
+
test("big prime") {
|
21
|
+
pending
|
22
|
+
NthPrime.prime(10001) should be (Some(104743))
|
23
|
+
}
|
24
|
+
|
25
|
+
test("there is no zeroth prime") {
|
26
|
+
pending
|
27
|
+
NthPrime.prime(0) should be (None)
|
28
|
+
}
|
29
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import java.io.File
|
2
|
+
|
3
|
+
import testgen.TestSuiteBuilder._
|
4
|
+
import testgen._
|
5
|
+
|
6
|
+
object NthPrimerTestGenerator {
|
7
|
+
def main(args: Array[String]): Unit = {
|
8
|
+
val file = new File("src/main/resources/nth-prime.json")
|
9
|
+
|
10
|
+
def toString(expected: CanonicalDataParser.Expected): String = {
|
11
|
+
expected match {
|
12
|
+
case Left(_) => "None"
|
13
|
+
case Right(false) => "None"
|
14
|
+
case Right(n) => s"Some($n)"
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
def fromLabeledTest(argNames: String*): ToTestCaseData =
|
19
|
+
withLabeledTest { sut =>
|
20
|
+
labeledTest =>
|
21
|
+
val args = sutArgs(labeledTest.result, argNames: _*)
|
22
|
+
val property = labeledTest.property
|
23
|
+
val sutCall =
|
24
|
+
s"""$sut.$property($args)"""
|
25
|
+
val expected = toString(labeledTest.expected)
|
26
|
+
TestCaseData(labeledTest.description, sutCall, expected)
|
27
|
+
}
|
28
|
+
|
29
|
+
val code = TestSuiteBuilder.build(file, fromLabeledTest("input"))
|
30
|
+
println(s"-------------")
|
31
|
+
println(code)
|
32
|
+
println(s"-------------")
|
33
|
+
}
|
34
|
+
}
|
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.
|
4
|
+
version: 2.2.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katrina Owen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
@@ -2364,6 +2364,7 @@ files:
|
|
2364
2364
|
- tracks/csharp/generators/Exercises/PerfectNumbers.cs
|
2365
2365
|
- tracks/csharp/generators/Exercises/PhoneNumber.cs
|
2366
2366
|
- tracks/csharp/generators/Exercises/PigLatin.cs
|
2367
|
+
- tracks/csharp/generators/Exercises/Poker.cs
|
2367
2368
|
- tracks/csharp/generators/Exercises/PrimeFactors.cs
|
2368
2369
|
- tracks/csharp/generators/Exercises/RailFenceCipher.cs
|
2369
2370
|
- tracks/csharp/generators/Exercises/Raindrops.cs
|
@@ -2379,6 +2380,7 @@ files:
|
|
2379
2380
|
- tracks/csharp/generators/Exercises/SumOfMultiples.cs
|
2380
2381
|
- tracks/csharp/generators/Exercises/Transpose.cs
|
2381
2382
|
- tracks/csharp/generators/Exercises/TwoFer.cs
|
2383
|
+
- tracks/csharp/generators/Exercises/WordCount.cs
|
2382
2384
|
- tracks/csharp/generators/Exercises/Wordy.cs
|
2383
2385
|
- tracks/csharp/generators/Generators.csproj
|
2384
2386
|
- tracks/csharp/generators/Generators.csproj.user
|
@@ -2588,7 +2590,6 @@ files:
|
|
2588
2590
|
- tracks/delphi/config/maintainers.json
|
2589
2591
|
- tracks/delphi/docs/ABOUT.md
|
2590
2592
|
- tracks/delphi/docs/EXERCISE_README_INSERT.md
|
2591
|
-
- tracks/delphi/docs/GETTING_STARTED_GUIDE.md
|
2592
2593
|
- tracks/delphi/docs/INSTALLATION.md
|
2593
2594
|
- tracks/delphi/docs/LEARNING.md
|
2594
2595
|
- tracks/delphi/docs/RESOURCES.md
|
@@ -2662,6 +2663,7 @@ files:
|
|
2662
2663
|
- tracks/delphi/exercises/hamming/README.md
|
2663
2664
|
- tracks/delphi/exercises/hamming/uHammingExample.pas
|
2664
2665
|
- tracks/delphi/exercises/hamming/uHammingTests.pas
|
2666
|
+
- tracks/delphi/exercises/hello-world/GETTING_STARTED_GUIDE.md
|
2665
2667
|
- tracks/delphi/exercises/hello-world/HelloWorld.dpr
|
2666
2668
|
- tracks/delphi/exercises/hello-world/README.md
|
2667
2669
|
- tracks/delphi/exercises/hello-world/uHelloWorldExample.pas
|
@@ -4132,12 +4134,10 @@ files:
|
|
4132
4134
|
- tracks/fsharp/.travis.yml
|
4133
4135
|
- tracks/fsharp/LICENSE
|
4134
4136
|
- tracks/fsharp/README.md
|
4135
|
-
- tracks/fsharp/appveyor.yml
|
4136
4137
|
- tracks/fsharp/bin/fetch-configlet
|
4137
4138
|
- tracks/fsharp/build.cmd
|
4138
4139
|
- tracks/fsharp/build.fsx
|
4139
4140
|
- tracks/fsharp/build.sh
|
4140
|
-
- tracks/fsharp/circle.yml
|
4141
4141
|
- tracks/fsharp/config.json
|
4142
4142
|
- tracks/fsharp/config/exercise_readme.go.tmpl
|
4143
4143
|
- tracks/fsharp/config/maintainers.json
|
@@ -4671,7 +4671,6 @@ files:
|
|
4671
4671
|
- tracks/go/exercises/hamming/hamming_test.go
|
4672
4672
|
- tracks/go/exercises/hello-world/README.md
|
4673
4673
|
- tracks/go/exercises/hello-world/example.go
|
4674
|
-
- tracks/go/exercises/hello-world/example_helloworld_test.go
|
4675
4674
|
- tracks/go/exercises/hello-world/hello_test.go
|
4676
4675
|
- tracks/go/exercises/hello-world/hello_world.go
|
4677
4676
|
- tracks/go/exercises/hexadecimal/README.md
|
@@ -4871,6 +4870,11 @@ files:
|
|
4871
4870
|
- tracks/go/exercises/twelve-days/README.md
|
4872
4871
|
- tracks/go/exercises/twelve-days/example.go
|
4873
4872
|
- tracks/go/exercises/twelve-days/twelve_days_test.go
|
4873
|
+
- tracks/go/exercises/two-fer/README.md
|
4874
|
+
- tracks/go/exercises/two-fer/example.go
|
4875
|
+
- tracks/go/exercises/two-fer/example_two_fer_test.go
|
4876
|
+
- tracks/go/exercises/two-fer/two_fer.go
|
4877
|
+
- tracks/go/exercises/two-fer/two_fer_test.go
|
4874
4878
|
- tracks/go/exercises/variable-length-quantity/.meta/gen.go
|
4875
4879
|
- tracks/go/exercises/variable-length-quantity/README.md
|
4876
4880
|
- tracks/go/exercises/variable-length-quantity/cases_test.go
|
@@ -10909,7 +10913,7 @@ files:
|
|
10909
10913
|
- tracks/scala/exercises/nth-prime/build.sbt
|
10910
10914
|
- tracks/scala/exercises/nth-prime/example.scala
|
10911
10915
|
- tracks/scala/exercises/nth-prime/src/main/scala/.keep
|
10912
|
-
- tracks/scala/exercises/nth-prime/src/test/scala/
|
10916
|
+
- tracks/scala/exercises/nth-prime/src/test/scala/NthPrimeTest.scala
|
10913
10917
|
- tracks/scala/exercises/nucleotide-count/HINTS.md
|
10914
10918
|
- tracks/scala/exercises/nucleotide-count/README.md
|
10915
10919
|
- tracks/scala/exercises/nucleotide-count/build.sbt
|
@@ -11161,6 +11165,7 @@ files:
|
|
11161
11165
|
- tracks/scala/testgen/src/main/scala/LeapTestGenerator.scala
|
11162
11166
|
- tracks/scala/testgen/src/main/scala/LuhnTestGenerator.scala
|
11163
11167
|
- tracks/scala/testgen/src/main/scala/MinesweeperTestGenerator.scala
|
11168
|
+
- tracks/scala/testgen/src/main/scala/NthPrimeTestGenerator.scala
|
11164
11169
|
- tracks/scala/testgen/src/main/scala/NucleotideCountTestGenerator.scala
|
11165
11170
|
- tracks/scala/testgen/src/main/scala/PangramsTestGenerator.scala
|
11166
11171
|
- tracks/scala/testgen/src/main/scala/PascalsTriangleTestGenerator.scala
|
data/tracks/fsharp/appveyor.yml
DELETED
data/tracks/fsharp/circle.yml
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
machine:
|
2
|
-
environment:
|
3
|
-
TERM: xterm-256color
|
4
|
-
dependencies:
|
5
|
-
pre:
|
6
|
-
- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
|
7
|
-
- echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
|
8
|
-
- sudo apt-get update
|
9
|
-
- sudo apt-get install mono-complete fsharp
|
10
|
-
test:
|
11
|
-
override:
|
12
|
-
- ./build.sh
|
13
|
-
post:
|
14
|
-
- mkdir -p $CIRCLE_TEST_REPORTS/junit/
|
15
|
-
- sed -i '1 s/^\xef\xbb\xbf//' .*/junit-results.xml
|
16
|
-
- find . -type f -regex ".*/junit-results.xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
|
@@ -1,37 +0,0 @@
|
|
1
|
-
import org.scalatest.{Matchers, FlatSpec}
|
2
|
-
|
3
|
-
class PrimeTest extends FlatSpec with Matchers {
|
4
|
-
it should "calculate 1st prime" in {
|
5
|
-
Prime.nth(1) should be (Some(2))
|
6
|
-
}
|
7
|
-
|
8
|
-
it should "calculate 2nd prime" in {
|
9
|
-
pending
|
10
|
-
Prime.nth(2) should be (Some(3))
|
11
|
-
}
|
12
|
-
|
13
|
-
it should "calculate 6th prime" in {
|
14
|
-
pending
|
15
|
-
Prime.nth(6) should be (Some(13))
|
16
|
-
}
|
17
|
-
|
18
|
-
it should "calculate 1000th prime" in {
|
19
|
-
pending
|
20
|
-
Prime.nth(1000) should be (Some(7919))
|
21
|
-
}
|
22
|
-
|
23
|
-
it should "calculate 10000th prime" in {
|
24
|
-
pending
|
25
|
-
Prime.nth(10000) should be (Some(104729))
|
26
|
-
}
|
27
|
-
|
28
|
-
it should "calculate 10001th prime" in {
|
29
|
-
pending
|
30
|
-
Prime.nth(10001) should be (Some(104743))
|
31
|
-
}
|
32
|
-
|
33
|
-
it should "not find zeroth prime" in {
|
34
|
-
pending
|
35
|
-
Prime.nth(0) should be (None)
|
36
|
-
}
|
37
|
-
}
|