trackler 2.0.3.8 → 2.0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/common/exercises/book-store/description.md +67 -0
- data/common/exercises/book-store/metadata.yml +4 -0
- data/lib/trackler/version.rb +1 -1
- data/tracks/crystal/exercises/difference-of-squares/src/difference_of_squares.cr +1 -0
- data/tracks/ecmascript/exercises/custom-set/package.json +1 -0
- data/tracks/ecmascript/exercises/palindrome-products/palindrome-products.js +18 -18
- data/tracks/fsharp/docs/INSTALLATION.md +2 -3
- data/tracks/fsharp/docs/TESTS.md +1 -1
- data/tracks/fsharp/exercises/accumulate/HINTS.md +3 -0
- data/tracks/fsharp/exercises/diamond/HINTS.md +2 -0
- data/tracks/fsharp/exercises/grains/HINTS.md +1 -1
- data/tracks/fsharp/exercises/hello-world/HINTS.md +1 -1
- data/tracks/fsharp/exercises/parallel-letter-frequency/HINTS.md +3 -0
- data/tracks/fsharp/exercises/poker/HINTS.md +2 -0
- data/tracks/fsharp/exercises/raindrops/HINTS.md +2 -0
- data/tracks/fsharp/exercises/space-age/HINTS.md +3 -0
- data/tracks/javascript/exercises/bowling/bowling.spec.js +83 -63
- data/tracks/ocaml/config.json +5 -0
- data/tracks/ocaml/exercises/leap/test.ml +7 -13
- data/tracks/ocaml/exercises/robot-name/.merlin +3 -0
- data/tracks/ocaml/exercises/robot-name/Makefile +11 -0
- data/tracks/ocaml/exercises/robot-name/example.ml +26 -0
- data/tracks/ocaml/exercises/robot-name/robot_name.mli +7 -0
- data/tracks/ocaml/exercises/robot-name/test.ml +64 -0
- data/tracks/ocaml/tools/test-generator/Makefile +3 -0
- data/tracks/ocaml/tools/test-generator/README.md +1 -0
- data/tracks/ocaml/tools/test-generator/src/canonical_data_checker.ml +23 -0
- data/tracks/ocaml/tools/test-generator/src/controller.ml +12 -0
- data/tracks/ocaml/tools/test-generator/src/parser.ml +29 -22
- data/tracks/ocaml/tools/test-generator/src/utils.ml +8 -0
- data/tracks/ocaml/tools/test-generator/test/clock.json +437 -0
- data/tracks/ocaml/tools/test-generator/test/parser_test.ml +18 -4
- data/tracks/ocaml/tools/test-generator/test/with-methods-key.json +22 -0
- data/tracks/perl6/config.json +5 -0
- data/tracks/perl6/exercises/wordy/Example.p6 +16 -0
- data/tracks/perl6/exercises/wordy/cases.json +89 -0
- data/tracks/perl6/exercises/wordy/wordy.t +29 -0
- data/tracks/ruby/exercises/acronym/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/alphametics/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/anagram/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/binary/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/bowling/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/bracket-push/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/clock/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/connect/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/custom-set/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/difference-of-squares/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/dominoes/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/gigasecond/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/hamming/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/hello-world/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/isogram/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/largest-series-product/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/leap/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/nth-prime/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/pangram/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/queen-attack/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/raindrops/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/rna-transcription/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/roman-numerals/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/run-length-encoding/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/sieve/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/tournament/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/transpose/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/triangle/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/two-bucket/{.version → .meta/.version} +0 -0
- data/tracks/ruby/exercises/word-count/{.version → .meta/.version} +0 -0
- data/tracks/ruby/lib/generator.rb +15 -4
- data/tracks/rust/config.json +1 -0
- data/tracks/rust/exercises/largest-series-product/.gitignore +7 -0
- data/tracks/rust/exercises/largest-series-product/Cargo.toml +3 -0
- data/tracks/rust/exercises/largest-series-product/HINTS.md +6 -0
- data/tracks/rust/exercises/largest-series-product/example.rs +22 -0
- data/tracks/rust/exercises/largest-series-product/tests/largest-series-product.rs +105 -0
- data/tracks/rust/problems.md +1 -0
- data/tracks/scala/.gitignore +1 -0
- data/tracks/scala/exercises/accumulate/src/test/scala/{accumulate_test.scala → AccumulateTest.scala} +0 -0
- data/tracks/scala/exercises/allergies/src/test/scala/{allergies_test.scala → AllergiesTest.scala} +0 -0
- data/tracks/scala/exercises/anagram/src/test/scala/{anagram_test.scala → AnagramTest.scala} +0 -0
- data/tracks/scala/exercises/binary/src/test/scala/{binary_test.scala → BinaryTest.scala} +0 -0
- data/tracks/scala/exercises/bob/src/test/scala/{bob_test.scala → BobTest.scala} +0 -0
- data/tracks/scala/exercises/difference-of-squares/src/test/scala/{squares_test.scala → SquaresTest.scala} +0 -0
- data/tracks/scala/exercises/etl/src/test/scala/{etl_test.scala → EtlTest.scala} +0 -0
- data/tracks/scala/exercises/gigasecond/src/test/scala/{gigasecond_test.scala → GigasecondTest.scala} +0 -0
- data/tracks/scala/exercises/grade-school/src/test/scala/{grade_school_test.scala → GradeSchoolTest.scala} +0 -0
- data/tracks/scala/exercises/grains/src/test/scala/{grains_test.scala → GrainsTest.scala} +0 -0
- data/tracks/scala/exercises/hamming/src/test/scala/{hamming_test.scala → HammingTest.scala} +0 -0
- data/tracks/scala/exercises/hello-world/src/test/scala/HelloWorldTest.scala +2 -0
- data/tracks/scala/exercises/leap/src/test/scala/{leap_test.scala → LeapTest.scala} +0 -0
- data/tracks/scala/exercises/meetup/src/test/scala/{meetup_test.scala → MeetupTest.scala} +0 -0
- data/tracks/scala/exercises/nth-prime/example.scala +3 -1
- data/tracks/scala/exercises/nth-prime/src/test/scala/PrimeTest.scala +11 -6
- data/tracks/scala/exercises/nucleotide-count/src/test/scala/{nucleotide_count_test.scala → NucleotideCountTest.scala} +0 -0
- data/tracks/scala/exercises/palindrome-products/src/test/scala/PalindromeProductsTest.scala +7 -0
- data/tracks/scala/exercises/pangram/src/test/scala/{PangramsTest.scala → PangramTest.scala} +0 -0
- data/tracks/scala/exercises/parallel-letter-frequency/HINTS.md +26 -0
- data/tracks/scala/exercises/phone-number/src/test/scala/{phone_number_test.scala → PhoneNumberTest.scala} +0 -0
- data/tracks/scala/exercises/prime-factors/src/test/scala/{primefactors_test.scala → PrimefactorsTest.scala} +10 -0
- data/tracks/scala/exercises/raindrops/src/test/scala/{raindrops_test.scala → RaindropsTest.scala} +15 -0
- data/tracks/scala/exercises/rna-transcription/src/test/scala/{transcription_test.scala → RnaTranscriptionTest.scala} +8 -0
- data/tracks/scala/exercises/robot-name/src/test/scala/{robot_name_test.scala → RobotNameTest.scala} +0 -0
- data/tracks/scala/exercises/roman-numerals/src/test/scala/{roman_numerals_test.scala → RomanNumeralsTest.scala} +17 -0
- data/tracks/scala/exercises/saddle-points/src/test/scala/{SaddlePointsSpecs.scala → SaddlePointsTest.scala} +3 -0
- data/tracks/scala/exercises/scrabble-score/src/test/scala/{scrabble_score_test.scala → ScrabbleScoreTest.scala} +0 -0
- data/tracks/scala/exercises/sgf-parsing/src/test/scala/SgfTest.scala +1 -0
- data/tracks/scala/exercises/space-age/src/test/scala/{space_age_test.scala → SpaceAgeTest.scala} +0 -0
- data/tracks/scala/exercises/sublist/src/test/scala/{sublist_test.scala → SublistTest.scala} +0 -0
- data/tracks/scala/exercises/triangle/src/test/scala/{triangle_test.scala → TriangleTest.scala} +7 -0
- data/tracks/scala/exercises/word-count/src/test/scala/{word_count_test.scala → WordCountTest.scala} +0 -0
- data/tracks/scala/exercises/zipper/src/test/scala/ZipperTest.scala +7 -0
- data/tracks/swift/config.json +19 -0
- data/tracks/swift/docs/TESTS.md +114 -23
- data/tracks/swift/exercises/beer-song/BeerSongExample.swift +32 -0
- data/tracks/swift/exercises/beer-song/BeerSongTest.swift +44 -0
- data/tracks/swift/exercises/hello-world/{helloWorldExample.swift → HelloWorldExample.swift} +4 -0
- data/tracks/swift/exercises/hello-world/{helloWorldTest/helloWorldTest.swift → helloWorldTest.swift} +1 -1
- data/tracks/swift/exercises/sublist/SubListTest.swift +95 -0
- data/tracks/swift/exercises/sublist/SublistExample.swift +72 -0
- data/tracks/swift/img/page_assets/001-splash.png +0 -0
- data/tracks/swift/img/page_assets/002-templateChooser.png +0 -0
- data/tracks/swift/img/page_assets/003-nameProject.jpg +0 -0
- data/tracks/swift/img/page_assets/004-saveProject.jpg +0 -0
- data/tracks/swift/img/page_assets/005-folderLayout.png +0 -0
- data/tracks/swift/img/page_assets/006-newProjectInitial.jpg +0 -0
- data/tracks/swift/img/page_assets/007-fileInspectorUpdate.png +0 -0
- data/tracks/swift/img/page_assets/008-templateChooserSwift.png +0 -0
- data/tracks/swift/img/page_assets/009-importTestSource.png +0 -0
- data/tracks/swift/img/page_assets/010-testsImportExample.png +0 -0
- data/tracks/swift/img/page_assets/011-finalLayoutExample.png +0 -0
- data/tracks/swift/xcodeProject/xSwift.xcodeproj/project.pbxproj +36 -56
- metadata +103 -65
- data/tracks/swift/exercises/hello-world/helloWorld.swift +0 -1
- data/tracks/swift/exercises/hello-world/helloWorld.xcodeproj/project.pbxproj +0 -256
- data/tracks/swift/exercises/hello-world/helloWorld.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- data/tracks/swift/exercises/hello-world/helloWorldTest/Info.plist +0 -24
data/tracks/rust/problems.md
CHANGED
|
@@ -36,6 +36,7 @@ pascals-triangle | Math, Vec, Index (optional)
|
|
|
36
36
|
scrabble-score | chaining higher-order functions, HashMap (optional)
|
|
37
37
|
pangram | filter, ascii (optional)
|
|
38
38
|
nucleotide-count | filter, entry api, mutablity, match
|
|
39
|
+
largest-series-product | Result, windows, higher-order functions, char
|
|
39
40
|
word-count | hashmap, str vs string, chars, entry api
|
|
40
41
|
atbash-cipher | str vs string, primitive types, iterators, chars, ascii
|
|
41
42
|
etl | btree
|
data/tracks/scala/.gitignore
CHANGED
data/tracks/scala/exercises/accumulate/src/test/scala/{accumulate_test.scala → AccumulateTest.scala}
RENAMED
|
File without changes
|
data/tracks/scala/exercises/allergies/src/test/scala/{allergies_test.scala → AllergiesTest.scala}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/tracks/scala/exercises/gigasecond/src/test/scala/{gigasecond_test.scala → GigasecondTest.scala}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -6,10 +6,12 @@ class HelloWorldTest extends FunSuite with Matchers {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
test("with name") {
|
|
9
|
+
pending
|
|
9
10
|
HelloWorld.hello("Jane") should be ("Hello, Jane!")
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
test("with umlaut name") {
|
|
14
|
+
pending
|
|
13
15
|
HelloWorld.hello("Jürgen") should be ("Hello, Jürgen!")
|
|
14
16
|
}
|
|
15
17
|
}
|
|
File without changes
|
|
File without changes
|
|
@@ -4,5 +4,7 @@ object Prime {
|
|
|
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 nth(n: Int): Int =
|
|
7
|
+
def nth(n: Int): Option[Int] =
|
|
8
|
+
if (n < 1) None
|
|
9
|
+
else Some(primes.drop(n - 1).head.toInt)
|
|
8
10
|
}
|
|
@@ -2,31 +2,36 @@ import org.scalatest.{Matchers, FlatSpec}
|
|
|
2
2
|
|
|
3
3
|
class PrimeTest extends FlatSpec with Matchers {
|
|
4
4
|
it should "calculate 1st prime" in {
|
|
5
|
-
Prime.nth(1) should be (2)
|
|
5
|
+
Prime.nth(1) should be (Some(2))
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
it should "calculate 2nd prime" in {
|
|
9
9
|
pending
|
|
10
|
-
Prime.nth(2) should be (3)
|
|
10
|
+
Prime.nth(2) should be (Some(3))
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
it should "calculate 6th prime" in {
|
|
14
14
|
pending
|
|
15
|
-
Prime.nth(6) should be (13)
|
|
15
|
+
Prime.nth(6) should be (Some(13))
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
it should "calculate 1000th prime" in {
|
|
19
19
|
pending
|
|
20
|
-
Prime.nth(1000) should be (7919)
|
|
20
|
+
Prime.nth(1000) should be (Some(7919))
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
it should "calculate 10000th prime" in {
|
|
24
24
|
pending
|
|
25
|
-
Prime.nth(10000) should be (104729)
|
|
25
|
+
Prime.nth(10000) should be (Some(104729))
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
it should "calculate 10001th prime" in {
|
|
29
29
|
pending
|
|
30
|
-
Prime.nth(10001) should be (104743)
|
|
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)
|
|
31
36
|
}
|
|
32
37
|
}
|
|
File without changes
|
|
@@ -9,42 +9,49 @@ class PalindromeProductsTest extends FlatSpec with Matchers {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
it should "find largest palindrome from a single digit factors" in {
|
|
12
|
+
pending
|
|
12
13
|
val (value, factors) = PalindromeProducts(0, 9).largest
|
|
13
14
|
value should be (9)
|
|
14
15
|
factors should be (Set((1, 9), (3, 3)))
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
it should "find smallest palindrome from a double digit factors" in {
|
|
19
|
+
pending
|
|
18
20
|
val (value, factors) = PalindromeProducts(10, 99).smallest
|
|
19
21
|
value should be (121)
|
|
20
22
|
factors should be (Set((11, 11)))
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
it should "find largest palindrome from a double digit factors" in {
|
|
26
|
+
pending
|
|
24
27
|
val (value, factors) = PalindromeProducts(10, 99).largest
|
|
25
28
|
value should be (9009)
|
|
26
29
|
factors should be (Set((91, 99)))
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
it should "find smallest palindrome from a triple digit factors" in {
|
|
33
|
+
pending
|
|
30
34
|
val (value, factors) = PalindromeProducts(100, 999).smallest
|
|
31
35
|
value should be (10201)
|
|
32
36
|
factors should be (Set((101, 101)))
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
it should "find largest palindrome from a triple digit factors" in {
|
|
40
|
+
pending
|
|
36
41
|
val (value, factors) = PalindromeProducts(100, 999).largest
|
|
37
42
|
value should be (906609)
|
|
38
43
|
factors should be (Set((913, 993)))
|
|
39
44
|
}
|
|
40
45
|
|
|
41
46
|
it should "find smallest palindrome from a four digit factors" in {
|
|
47
|
+
pending
|
|
42
48
|
val (value, factors) = PalindromeProducts(1000, 9999).smallest
|
|
43
49
|
value should be (1002001)
|
|
44
50
|
factors should be (Set((1001, 1001)))
|
|
45
51
|
}
|
|
46
52
|
|
|
47
53
|
it should "find largest palindrome from a four digit factors" in {
|
|
54
|
+
pending
|
|
48
55
|
val (value, factors) = PalindromeProducts(1000, 9999).largest
|
|
49
56
|
value should be (99000099)
|
|
50
57
|
factors should be (Set((9901, 9999)))
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
## Hints
|
|
2
|
+
According to [this terminology](http://chimera.labs.oreilly.com/books/1230000000929/ch01.html#sec_terminology) you should write a *parallel* and *deterministic*
|
|
3
|
+
program and (by all means!) let Scala deal with the *concurrency* aspect.
|
|
4
|
+
Or else your code could quickly get messy and error-prone with all kinds of nasty
|
|
5
|
+
concurrency bugs. In particular your program could become indeterministic
|
|
6
|
+
which spells in practice: very (in fact, VERY) hard to debug, test and reason about.
|
|
7
|
+
|
|
8
|
+
Having said that it might be a good idea to first write a sequential solution (and
|
|
9
|
+
use the test suite to verify it).
|
|
10
|
+
Only then should you try to parallelize it while keeping the sequential and parallel
|
|
11
|
+
portions of your code as separate as possible.
|
|
12
|
+
|
|
13
|
+
A first iteration could be using Scala's [parallel collections](http://docs.scala-lang.org/overviews/parallel-collections/overview.html). You might find
|
|
14
|
+
that this is almost too simple (especially if you have followed our advice and
|
|
15
|
+
already have a sequential solution).
|
|
16
|
+
|
|
17
|
+
For the second iteration we recommend you try a solution with [scala.concurrent.Future](http://www.scala-lang.org/api/current/scala/concurrent/Future$.html).
|
|
18
|
+
You can consult [this tutorial](http://danielwestheide.com/blog/2013/01/09/the-neophytes-guide-to-scala-part-8-welcome-to-the-future.html) and [its sequel](http://danielwestheide.com/blog/2013/01/16/the-neophytes-guide-to-scala-part-9-promises-and-futures-in-practice.html) for some help.
|
|
19
|
+
Make sure that you
|
|
20
|
+
- have only one single blocking call to wait for the result
|
|
21
|
+
- that it is at the very end of your program, and
|
|
22
|
+
- that it has a timeout.
|
|
23
|
+
|
|
24
|
+
`scala.concurrent.Future` is used in many libraries and the doctor's advice for
|
|
25
|
+
parallel and asynchronous programming in Scala. So it is essential for mastering
|
|
26
|
+
the language and it should become part of your Scala armory.
|
|
File without changes
|
|
@@ -6,42 +6,52 @@ class PrimeFactorsTest extends FlatSpec with Matchers {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
it should "calc prime factors of 2" in {
|
|
9
|
+
pending
|
|
9
10
|
PrimeFactors.forNumber(2) should be (List(2))
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
it should "calc prime factors of 3" in {
|
|
14
|
+
pending
|
|
13
15
|
PrimeFactors.forNumber(3) should be (List(3))
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
it should "calc prime factors of 4" in {
|
|
19
|
+
pending
|
|
17
20
|
PrimeFactors.forNumber(4) should be (List(2, 2))
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
it should "calc prime factors of 6" in {
|
|
24
|
+
pending
|
|
21
25
|
PrimeFactors.forNumber(6) should be (List(2, 3))
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
it should "calc prime factors of 8" in {
|
|
29
|
+
pending
|
|
25
30
|
PrimeFactors.forNumber(8) should be (List(2, 2, 2))
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
it should "calc prime factors of 9" in {
|
|
34
|
+
pending
|
|
29
35
|
PrimeFactors.forNumber(9) should be (List(3, 3))
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
it should "calc prime factors of 27" in {
|
|
39
|
+
pending
|
|
33
40
|
PrimeFactors.forNumber(27) should be (List(3, 3, 3))
|
|
34
41
|
}
|
|
35
42
|
|
|
36
43
|
it should "calc prime factors of 625" in {
|
|
44
|
+
pending
|
|
37
45
|
PrimeFactors.forNumber(625) should be (List(5, 5, 5, 5))
|
|
38
46
|
}
|
|
39
47
|
|
|
40
48
|
it should "calc prime factors of 901255" in {
|
|
49
|
+
pending
|
|
41
50
|
PrimeFactors.forNumber(901255) should be (List(5, 17, 23, 461))
|
|
42
51
|
}
|
|
43
52
|
|
|
44
53
|
it should "calc prime factors of 93819012551" in {
|
|
54
|
+
pending
|
|
45
55
|
PrimeFactors.forNumber(Long.MaxValue) should be (List(7, 7, 73, 127, 337, 92737, 649657))
|
|
46
56
|
}
|
|
47
57
|
}
|
data/tracks/scala/exercises/raindrops/src/test/scala/{raindrops_test.scala → RaindropsTest.scala}
RENAMED
|
@@ -6,62 +6,77 @@ class RaindropsTest extends FlatSpec with Matchers {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
it should "convert 3" in {
|
|
9
|
+
pending
|
|
9
10
|
Raindrops().convert(3) should equal("Pling")
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
it should "convert 5" in {
|
|
14
|
+
pending
|
|
13
15
|
Raindrops().convert(5) should equal("Plang")
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
it should "convert 7" in {
|
|
19
|
+
pending
|
|
17
20
|
Raindrops().convert(7) should equal("Plong")
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
it should "convert 6" in {
|
|
24
|
+
pending
|
|
21
25
|
Raindrops().convert(6) should equal("Pling")
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
it should "convert 9" in {
|
|
29
|
+
pending
|
|
25
30
|
Raindrops().convert(9) should equal("Pling")
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
it should "convert 10" in {
|
|
34
|
+
pending
|
|
29
35
|
Raindrops().convert(10) should equal("Plang")
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
it should "convert 14" in {
|
|
39
|
+
pending
|
|
33
40
|
Raindrops().convert(14) should equal("Plong")
|
|
34
41
|
}
|
|
35
42
|
|
|
36
43
|
it should "convert 15" in {
|
|
44
|
+
pending
|
|
37
45
|
Raindrops().convert(15) should equal("PlingPlang")
|
|
38
46
|
}
|
|
39
47
|
|
|
40
48
|
it should "convert 21" in {
|
|
49
|
+
pending
|
|
41
50
|
Raindrops().convert(21) should equal("PlingPlong")
|
|
42
51
|
}
|
|
43
52
|
|
|
44
53
|
it should "convert 25" in {
|
|
54
|
+
pending
|
|
45
55
|
Raindrops().convert(25) should equal("Plang")
|
|
46
56
|
}
|
|
47
57
|
|
|
48
58
|
it should "convert 35" in {
|
|
59
|
+
pending
|
|
49
60
|
Raindrops().convert(35) should equal("PlangPlong")
|
|
50
61
|
}
|
|
51
62
|
|
|
52
63
|
it should "convert 49" in {
|
|
64
|
+
pending
|
|
53
65
|
Raindrops().convert(49) should equal("Plong")
|
|
54
66
|
}
|
|
55
67
|
|
|
56
68
|
it should "convert 52" in {
|
|
69
|
+
pending
|
|
57
70
|
Raindrops().convert(52) should equal("52")
|
|
58
71
|
}
|
|
59
72
|
|
|
60
73
|
it should "convert 105" in {
|
|
74
|
+
pending
|
|
61
75
|
Raindrops().convert(105) should equal("PlingPlangPlong")
|
|
62
76
|
}
|
|
63
77
|
|
|
64
78
|
it should "convert 12121" in {
|
|
79
|
+
pending
|
|
65
80
|
Raindrops().convert(12121) should equal("12121")
|
|
66
81
|
}
|
|
67
82
|
}
|
|
@@ -6,34 +6,42 @@ class DnaTest extends FunSuite with Matchers {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
test("transcribes cytidine to guanine") {
|
|
9
|
+
pending
|
|
9
10
|
Dna.toRna("C") should be (Some("G"))
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
test("transcribes guanosine to cytosine") {
|
|
14
|
+
pending
|
|
13
15
|
Dna.toRna("G") should be (Some("C"))
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
test("transcribes adenosine to uracil") {
|
|
19
|
+
pending
|
|
17
20
|
Dna.toRna("A") should be (Some("U"))
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
test("transcribes thymidine to adenine") {
|
|
24
|
+
pending
|
|
21
25
|
Dna.toRna("T") should be (Some("A"))
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
test("transcribes all ACGT to UGCA") {
|
|
29
|
+
pending
|
|
25
30
|
Dna.toRna("ACGTGGTCTTAA") should be (Some("UGCACCAGAAUU"))
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
test("transcribes RNA only nucleotide uracil to None") {
|
|
34
|
+
pending
|
|
29
35
|
Dna.toRna("U") should be (None)
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
test("transcribes completely invalid DNA to None") {
|
|
39
|
+
pending
|
|
33
40
|
Dna.toRna("XXX") should be (None)
|
|
34
41
|
}
|
|
35
42
|
|
|
36
43
|
test("transcribes partially invalid DNA to None") {
|
|
44
|
+
pending
|
|
37
45
|
Dna.toRna("ACGTXXXCTTAA") should be (None)
|
|
38
46
|
}
|
|
39
47
|
}
|
data/tracks/scala/exercises/robot-name/src/test/scala/{robot_name_test.scala → RobotNameTest.scala}
RENAMED
|
File without changes
|
|
@@ -7,70 +7,87 @@ class RomanNumeralsSpecs extends FunSpec with Matchers {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
it ("1 equals I") {
|
|
10
|
+
pending
|
|
10
11
|
RomanNumeral(1).value should be ("I")
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
it ("2 equals II") {
|
|
15
|
+
pending
|
|
14
16
|
RomanNumeral(2).value should be ("II")
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
it ("3 equals III") {
|
|
20
|
+
pending
|
|
18
21
|
RomanNumeral(3).value should be ("III")
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
it ("4 equals IV") {
|
|
25
|
+
pending
|
|
22
26
|
RomanNumeral(4).value should be ("IV")
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
it ("5 equals V") {
|
|
30
|
+
pending
|
|
26
31
|
RomanNumeral(5).value should be ("V")
|
|
27
32
|
}
|
|
28
33
|
|
|
29
34
|
it ("6 equals VI") {
|
|
35
|
+
pending
|
|
30
36
|
RomanNumeral(6).value should be ("VI")
|
|
31
37
|
}
|
|
32
38
|
|
|
33
39
|
it ("9 equals IX") {
|
|
40
|
+
pending
|
|
34
41
|
RomanNumeral(9).value should be ("IX")
|
|
35
42
|
}
|
|
36
43
|
|
|
37
44
|
it ("27 equals XXVII") {
|
|
45
|
+
pending
|
|
38
46
|
RomanNumeral(27).value should be ("XXVII")
|
|
39
47
|
}
|
|
40
48
|
|
|
41
49
|
it ("48 equals XLVIII") {
|
|
50
|
+
pending
|
|
42
51
|
RomanNumeral(48).value should be ("XLVIII")
|
|
43
52
|
}
|
|
44
53
|
|
|
45
54
|
it ("59 equals LIX") {
|
|
55
|
+
pending
|
|
46
56
|
RomanNumeral(59).value should be ("LIX")
|
|
47
57
|
}
|
|
48
58
|
|
|
49
59
|
it ("93 equals XCIII") {
|
|
60
|
+
pending
|
|
50
61
|
RomanNumeral(93).value should be ("XCIII")
|
|
51
62
|
}
|
|
52
63
|
|
|
53
64
|
it ("141 equals CXLI") {
|
|
65
|
+
pending
|
|
54
66
|
RomanNumeral(141).value should be ("CXLI")
|
|
55
67
|
}
|
|
56
68
|
|
|
57
69
|
it ("402 equals CDII") {
|
|
70
|
+
pending
|
|
58
71
|
RomanNumeral(402).value should be ("CDII")
|
|
59
72
|
}
|
|
60
73
|
|
|
61
74
|
it ("575 equals DLXXV") {
|
|
75
|
+
pending
|
|
62
76
|
RomanNumeral(575).value should be ("DLXXV")
|
|
63
77
|
}
|
|
64
78
|
|
|
65
79
|
it ("911 equals CMXI") {
|
|
80
|
+
pending
|
|
66
81
|
RomanNumeral(911).value should be ("CMXI")
|
|
67
82
|
}
|
|
68
83
|
|
|
69
84
|
it ("1024 equals MXXIV") {
|
|
85
|
+
pending
|
|
70
86
|
RomanNumeral(1024).value should be ("MXXIV")
|
|
71
87
|
}
|
|
72
88
|
|
|
73
89
|
it ("3000 equals MMM") {
|
|
90
|
+
pending
|
|
74
91
|
RomanNumeral(3000).value should be ("MMM")
|
|
75
92
|
}
|
|
76
93
|
}
|