trackler 2.2.1.54 → 2.2.1.55
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/problem-specifications/exercises/dominoes/description.md +3 -3
- data/problem-specifications/exercises/two-fer/description.md +0 -28
- data/tracks/c/config.json +12 -0
- data/tracks/c/exercises/queen-attack/README.md +65 -0
- data/tracks/c/exercises/queen-attack/makefile +15 -0
- data/tracks/c/exercises/queen-attack/src/example.c +25 -0
- data/tracks/c/exercises/queen-attack/src/queen_attack.h +19 -0
- data/tracks/c/exercises/queen-attack/test/test_queen_attack.c +190 -0
- data/tracks/c/exercises/queen-attack/test/vendor/unity.c +1300 -0
- data/tracks/c/exercises/queen-attack/test/vendor/unity.h +274 -0
- data/tracks/c/exercises/queen-attack/test/vendor/unity_internals.h +701 -0
- data/tracks/common-lisp/exercises/acronym/README.md +1 -1
- data/tracks/delphi/exercises/two-fer/README.md +0 -28
- data/tracks/ecmascript/config.json +41 -0
- data/tracks/ecmascript/exercises/accumulate/package.json +5 -3
- data/tracks/ecmascript/exercises/acronym/package.json +5 -3
- data/tracks/ecmascript/exercises/all-your-base/package.json +5 -3
- data/tracks/ecmascript/exercises/allergies/package.json +5 -3
- data/tracks/ecmascript/exercises/alphametics/package.json +5 -3
- data/tracks/ecmascript/exercises/anagram/package.json +5 -3
- data/tracks/ecmascript/exercises/atbash-cipher/package.json +5 -3
- data/tracks/ecmascript/exercises/beer-song/package.json +5 -3
- data/tracks/ecmascript/exercises/binary-search-tree/package.json +5 -3
- data/tracks/ecmascript/exercises/binary-search/package.json +5 -3
- data/tracks/ecmascript/exercises/binary/package.json +5 -3
- data/tracks/ecmascript/exercises/bob/package.json +5 -3
- data/tracks/ecmascript/exercises/bowling/package.json +2 -2
- data/tracks/ecmascript/exercises/bracket-push/package.json +5 -3
- data/tracks/ecmascript/exercises/change/README.md +44 -0
- data/tracks/ecmascript/exercises/change/change.spec.js +80 -0
- data/tracks/ecmascript/exercises/change/example.js +120 -0
- data/tracks/ecmascript/exercises/change/package.json +69 -0
- data/tracks/ecmascript/exercises/circular-buffer/package.json +5 -3
- data/tracks/ecmascript/exercises/clock/package.json +5 -3
- data/tracks/ecmascript/exercises/collatz-conjecture/package.json +6 -4
- data/tracks/ecmascript/exercises/connect/package.json +5 -3
- data/tracks/ecmascript/exercises/crypto-square/package.json +5 -3
- data/tracks/ecmascript/exercises/custom-set/package.json +5 -3
- data/tracks/ecmascript/exercises/diamond/package.json +5 -3
- data/tracks/ecmascript/exercises/difference-of-squares/package.json +5 -3
- data/tracks/ecmascript/exercises/diffie-hellman/package.json +5 -3
- data/tracks/ecmascript/exercises/etl/package.json +5 -3
- data/tracks/ecmascript/exercises/flatten-array/package.json +5 -3
- data/tracks/ecmascript/exercises/food-chain/package.json +5 -3
- data/tracks/ecmascript/exercises/gigasecond/package.json +5 -3
- data/tracks/ecmascript/exercises/grade-school/package.json +5 -3
- data/tracks/ecmascript/exercises/grains/package.json +5 -3
- data/tracks/ecmascript/exercises/hamming/package.json +5 -3
- data/tracks/ecmascript/exercises/hello-world/package.json +5 -3
- data/tracks/ecmascript/exercises/hexadecimal/package.json +5 -3
- data/tracks/ecmascript/exercises/isbn-verifier/README.md +62 -0
- data/tracks/ecmascript/exercises/isbn-verifier/example.js +17 -0
- data/tracks/ecmascript/exercises/isbn-verifier/isbn-verifier.spec.js +81 -0
- data/tracks/ecmascript/exercises/isbn-verifier/package.json +71 -0
- data/tracks/ecmascript/exercises/isogram/package.json +5 -3
- data/tracks/ecmascript/exercises/kindergarten-garden/package.json +5 -3
- data/tracks/ecmascript/exercises/largest-series-product/package.json +5 -3
- data/tracks/ecmascript/exercises/leap/package.json +5 -3
- data/tracks/ecmascript/exercises/linked-list/package.json +5 -3
- data/tracks/ecmascript/exercises/list-ops/package.json +5 -3
- data/tracks/ecmascript/exercises/luhn/package.json +5 -3
- data/tracks/ecmascript/exercises/matrix/package.json +5 -3
- data/tracks/ecmascript/exercises/meetup/package.json +5 -3
- data/tracks/ecmascript/exercises/minesweeper/package.json +5 -3
- data/tracks/ecmascript/exercises/nth-prime/package.json +5 -3
- data/tracks/ecmascript/exercises/ocr-numbers/package.json +5 -3
- data/tracks/ecmascript/exercises/octal/package.json +5 -3
- data/tracks/ecmascript/exercises/palindrome-products/package.json +5 -3
- data/tracks/ecmascript/exercises/pangram/package.json +5 -3
- data/tracks/ecmascript/exercises/pascals-triangle/package.json +5 -3
- data/tracks/ecmascript/exercises/perfect-numbers/package.json +5 -3
- data/tracks/ecmascript/exercises/phone-number/package.json +5 -3
- data/tracks/ecmascript/exercises/pig-latin/package.json +5 -3
- data/tracks/ecmascript/exercises/prime-factors/package.json +5 -3
- data/tracks/ecmascript/exercises/proverb/package.json +5 -3
- data/tracks/ecmascript/exercises/pythagorean-triplet/package.json +5 -3
- data/tracks/ecmascript/exercises/queen-attack/package.json +5 -3
- data/tracks/ecmascript/exercises/raindrops/package.json +5 -3
- data/tracks/ecmascript/exercises/rna-transcription/package.json +5 -3
- data/tracks/ecmascript/exercises/robot-name/package.json +5 -3
- data/tracks/ecmascript/exercises/robot-simulator/package.json +5 -3
- data/tracks/ecmascript/exercises/roman-numerals/package.json +5 -3
- data/tracks/ecmascript/exercises/run-length-encoding/package.json +5 -3
- data/tracks/ecmascript/exercises/saddle-points/package.json +5 -3
- data/tracks/ecmascript/exercises/say/package.json +5 -3
- data/tracks/ecmascript/exercises/scrabble-score/package.json +5 -3
- data/tracks/ecmascript/exercises/secret-handshake/package.json +5 -3
- data/tracks/ecmascript/exercises/series/package.json +5 -3
- data/tracks/ecmascript/exercises/sieve/package.json +5 -3
- data/tracks/ecmascript/exercises/simple-cipher/package.json +5 -3
- data/tracks/ecmascript/exercises/simple-linked-list/package.json +5 -3
- data/tracks/ecmascript/exercises/space-age/package.json +5 -3
- data/tracks/ecmascript/exercises/strain/package.json +5 -3
- data/tracks/ecmascript/exercises/sublist/package.json +5 -3
- data/tracks/ecmascript/exercises/sum-of-multiples/package.json +5 -3
- data/tracks/ecmascript/exercises/transpose/README.md +94 -0
- data/tracks/ecmascript/exercises/transpose/example.js +12 -0
- data/tracks/ecmascript/exercises/transpose/package.json +71 -0
- data/tracks/ecmascript/exercises/transpose/transpose.spec.js +67 -0
- data/tracks/ecmascript/exercises/triangle/package.json +5 -3
- data/tracks/ecmascript/exercises/trinary/package.json +5 -3
- data/tracks/ecmascript/exercises/twelve-days/package.json +5 -3
- data/tracks/ecmascript/exercises/two-bucket/package.json +5 -3
- data/tracks/ecmascript/exercises/two-fer/package.json +5 -3
- data/tracks/ecmascript/exercises/word-count/package.json +5 -3
- data/tracks/ecmascript/exercises/word-search/package.json +5 -3
- data/tracks/ecmascript/exercises/wordy/package.json +5 -3
- data/tracks/ecmascript/package-lock.json +6219 -0
- data/tracks/ecmascript/package.json +5 -3
- data/tracks/erlang/exercises/collatz-conjecture/src/collatz_conjecture.erl +3 -4
- data/tracks/erlang/exercises/collatz-conjecture/src/example.erl +3 -3
- data/tracks/erlang/exercises/collatz-conjecture/test/collatz_conjecture_tests.erl +13 -9
- data/tracks/erlang/exercises/hello-world/src/hello_world.erl +2 -2
- data/tracks/erlang/exercises/leap/src/example.erl +1 -1
- data/tracks/erlang/exercises/leap/src/leap.erl +3 -3
- data/tracks/erlang/exercises/leap/test/leap_tests.erl +9 -9
- data/tracks/erlang/testgen/src/testgen.erl +16 -13
- data/tracks/erlang/testgen/src/tgen.erl +65 -38
- data/tracks/erlang/testgen/src/tgen_collatz-conjecture.erl +38 -0
- data/tracks/erlang/testgen/src/tgen_hello-world.erl +11 -19
- data/tracks/erlang/testgen/src/tgen_leap.erl +31 -0
- data/tracks/erlang/testgen/src/tgs.erl +80 -0
- data/tracks/fsharp/exercises/alphametics/AlphameticsTest.fs +78 -23
- data/tracks/fsharp/exercises/anagram/AnagramTest.fs +66 -34
- data/tracks/fsharp/exercises/connect/ConnectTest.fs +81 -68
- data/tracks/fsharp/exercises/connect/Example.fs +9 -5
- data/tracks/fsharp/exercises/food-chain/Example.fs +5 -9
- data/tracks/fsharp/exercises/food-chain/FoodChain.fs +2 -2
- data/tracks/fsharp/exercises/food-chain/FoodChainTest.fs +143 -75
- data/tracks/fsharp/exercises/hamming/Example.fs +8 -4
- data/tracks/fsharp/exercises/hamming/Hamming.fs +1 -1
- data/tracks/fsharp/exercises/hamming/HammingTest.fs +53 -13
- data/tracks/fsharp/exercises/house/Example.fs +5 -6
- data/tracks/fsharp/exercises/house/House.fs +3 -1
- data/tracks/fsharp/exercises/house/HouseTest.fs +272 -96
- data/tracks/fsharp/exercises/meetup/Example.fs +1 -1
- data/tracks/fsharp/exercises/meetup/Meetup.fs +1 -1
- data/tracks/fsharp/exercises/meetup/MeetupTest.fs +384 -73
- data/tracks/fsharp/exercises/ocr-numbers/Example.fs +43 -35
- data/tracks/fsharp/exercises/ocr-numbers/OcrNumbersTest.fs +160 -125
- data/tracks/fsharp/exercises/two-fer/Example.fs +4 -2
- data/tracks/fsharp/exercises/two-fer/TwoFer.fs +1 -1
- data/tracks/fsharp/exercises/two-fer/TwoFerTest.fs +7 -4
- data/tracks/fsharp/generators/Common.fs +6 -2
- data/tracks/fsharp/generators/Exercise.fs +14 -13
- data/tracks/fsharp/generators/Generators.fs +145 -2
- data/tracks/fsharp/generators/Options.fs +4 -6
- data/tracks/fsharp/generators/Output.fs +2 -2
- data/tracks/fsharp/generators/Program.fs +4 -3
- data/tracks/java/exercises/saddle-points/README.md +1 -1
- data/tracks/java/exercises/two-fer/README.md +0 -28
- data/tracks/javascript/exercises/beer-song/example.js +18 -14
- data/tracks/kotlin/exercises/saddle-points/README.md +1 -1
- data/tracks/kotlin/exercises/two-fer/README.md +0 -28
- data/tracks/lua/config.json +12 -0
- data/tracks/lua/exercises/collatz-conjecture/README.md +43 -0
- data/tracks/lua/exercises/collatz-conjecture/collatz-conjecture_spec.lua +33 -0
- data/tracks/lua/exercises/collatz-conjecture/example.lua +16 -0
- data/tracks/python/config.json +4 -1
- data/tracks/python/exercises/binary-search/binary_search_test.py +2 -0
- data/tracks/python/exercises/change/change_test.py +2 -0
- data/tracks/python/exercises/circular-buffer/circular_buffer_test.py +56 -50
- data/tracks/python/exercises/forth/example.py +3 -1
- data/tracks/python/exercises/forth/forth_test.py +43 -26
- data/tracks/python/exercises/nth-prime/nth_prime.py +1 -1
- data/tracks/python/exercises/rna-transcription/README.md +5 -0
- data/tracks/python/exercises/rna-transcription/example.py +1 -1
- data/tracks/python/exercises/rna-transcription/rna_transcription_test.py +7 -4
- data/tracks/python/exercises/robot-simulator/robot_simulator_test.py +9 -7
- data/tracks/python/exercises/saddle-points/saddle_points_test.py +15 -5
- data/tracks/python/exercises/simple-cipher/simple_cipher.py +7 -1
- data/tracks/python/exercises/word-count/example.py +6 -4
- data/tracks/python/exercises/word-count/word_count_test.py +49 -22
- data/tracks/python/exercises/word-search/word_search_test.py +104 -12
- data/tracks/rust/.travis.yml +2 -0
- data/tracks/rust/README.md +5 -0
- data/tracks/rust/_test/check-exercises.sh +0 -6
- data/tracks/rust/_test/ensure-lib-src-rs-exist.sh +19 -0
- data/tracks/rust/_test/ensure-stubs-compile.sh +26 -0
- data/tracks/rust/config.json +12 -0
- data/tracks/rust/config/exercise-readme-insert.md +3 -2
- data/tracks/rust/docs/ABOUT.md +2 -2
- data/tracks/rust/docs/LEARNING.md +1 -1
- data/tracks/rust/docs/RESOURCES.md +1 -1
- data/tracks/rust/docs/TESTS.md +2 -2
- data/tracks/rust/exercises/accumulate/README.md +3 -2
- data/tracks/rust/exercises/acronym/README.md +3 -2
- data/tracks/rust/exercises/all-your-base/README.md +3 -2
- data/tracks/rust/exercises/allergies/README.md +3 -2
- data/tracks/rust/exercises/alphametics/README.md +3 -2
- data/tracks/rust/exercises/anagram/README.md +3 -2
- data/tracks/rust/exercises/atbash-cipher/README.md +3 -2
- data/tracks/rust/exercises/beer-song/README.md +3 -2
- data/tracks/rust/exercises/beer-song/src/lib.rs +2 -2
- data/tracks/rust/exercises/binary-search/README.md +3 -2
- data/tracks/rust/exercises/bob/README.md +3 -2
- data/tracks/rust/exercises/bob/src/lib.rs +1 -1
- data/tracks/rust/exercises/bowling/README.md +3 -2
- data/tracks/rust/exercises/bracket-push/HINTS.md +1 -1
- data/tracks/rust/exercises/bracket-push/README.md +4 -3
- data/tracks/rust/exercises/circular-buffer/README.md +3 -2
- data/tracks/rust/exercises/clock/README.md +3 -2
- data/tracks/rust/exercises/collatz-conjecture/README.md +3 -2
- data/tracks/rust/exercises/collatz-conjecture/src/lib.rs +1 -1
- data/tracks/rust/exercises/crypto-square/README.md +3 -2
- data/tracks/rust/exercises/custom-set/README.md +3 -2
- data/tracks/rust/exercises/decimal/.meta/ALLOWED_TO_NOT_COMPILE +2 -0
- data/tracks/rust/exercises/decimal/README.md +3 -2
- data/tracks/rust/exercises/difference-of-squares/README.md +3 -2
- data/tracks/rust/exercises/difference-of-squares/src/lib.rs +3 -3
- data/tracks/rust/exercises/dominoes/README.md +3 -2
- data/tracks/rust/exercises/etl/README.md +3 -2
- data/tracks/rust/exercises/forth/README.md +3 -2
- data/tracks/rust/exercises/forth/src/lib.rs +3 -0
- data/tracks/rust/exercises/gigasecond/README.md +3 -2
- data/tracks/rust/exercises/grade-school/README.md +3 -2
- data/tracks/rust/exercises/grains/README.md +3 -2
- data/tracks/rust/exercises/hamming/README.md +3 -2
- data/tracks/rust/exercises/hello-world/GETTING_STARTED.md +1 -1
- data/tracks/rust/exercises/hello-world/README.md +3 -2
- data/tracks/rust/exercises/hexadecimal/README.md +3 -2
- data/tracks/rust/exercises/isogram/.gitignore +8 -0
- data/tracks/rust/exercises/isogram/Cargo.toml +3 -0
- data/tracks/rust/exercises/isogram/README.md +52 -0
- data/tracks/rust/exercises/isogram/example.rs +12 -0
- data/tracks/rust/exercises/isogram/src/lib.rs +0 -0
- data/tracks/rust/exercises/isogram/tests/isogram.rs +72 -0
- data/tracks/rust/exercises/largest-series-product/README.md +3 -2
- data/tracks/rust/exercises/leap/README.md +3 -2
- data/tracks/rust/exercises/leap/src/lib.rs +1 -1
- data/tracks/rust/exercises/luhn-from/README.md +3 -2
- data/tracks/rust/exercises/luhn-trait/.meta/description.md +2 -2
- data/tracks/rust/exercises/luhn-trait/README.md +5 -4
- data/tracks/rust/exercises/luhn/README.md +3 -2
- data/tracks/rust/exercises/minesweeper/README.md +3 -2
- data/tracks/rust/exercises/nth-prime/README.md +3 -2
- data/tracks/rust/exercises/nucleotide-codons/README.md +3 -2
- data/tracks/rust/exercises/nucleotide-count/README.md +3 -2
- data/tracks/rust/exercises/ocr-numbers/README.md +3 -2
- data/tracks/rust/exercises/pangram/README.md +3 -2
- data/tracks/rust/exercises/parallel-letter-frequency/HINTS.md +1 -1
- data/tracks/rust/exercises/parallel-letter-frequency/README.md +4 -3
- data/tracks/rust/exercises/pascals-triangle/README.md +3 -2
- data/tracks/rust/exercises/perfect-numbers/README.md +3 -2
- data/tracks/rust/exercises/phone-number/README.md +3 -2
- data/tracks/rust/exercises/pig-latin/README.md +3 -2
- data/tracks/rust/exercises/poker/README.md +3 -2
- data/tracks/rust/exercises/prime-factors/README.md +3 -2
- data/tracks/rust/exercises/protein-translation/README.md +3 -2
- data/tracks/rust/exercises/proverb/README.md +3 -2
- data/tracks/rust/exercises/proverb/src/lib.rs +1 -1
- data/tracks/rust/exercises/pythagorean-triplet/README.md +3 -2
- data/tracks/rust/exercises/queen-attack/README.md +3 -2
- data/tracks/rust/exercises/raindrops/README.md +3 -2
- data/tracks/rust/exercises/raindrops/src/lib.rs +1 -1
- data/tracks/rust/exercises/react/README.md +3 -2
- data/tracks/rust/exercises/rectangles/README.md +3 -2
- data/tracks/rust/exercises/rna-transcription/README.md +3 -2
- data/tracks/rust/exercises/robot-name/README.md +3 -2
- data/tracks/rust/exercises/robot-simulator/README.md +3 -2
- data/tracks/rust/exercises/roman-numerals/README.md +3 -2
- data/tracks/rust/exercises/rotational-cipher/README.md +3 -2
- data/tracks/rust/exercises/run-length-encoding/README.md +3 -2
- data/tracks/rust/exercises/say/README.md +3 -2
- data/tracks/rust/exercises/scrabble-score/README.md +3 -2
- data/tracks/rust/exercises/sieve/README.md +3 -2
- data/tracks/rust/exercises/space-age/README.md +3 -2
- data/tracks/rust/exercises/sublist/README.md +3 -2
- data/tracks/rust/exercises/sum-of-multiples/README.md +3 -2
- data/tracks/rust/exercises/sum-of-multiples/src/lib.rs +1 -1
- data/tracks/rust/exercises/tournament/README.md +3 -2
- data/tracks/rust/exercises/triangle/HINTS.md +2 -2
- data/tracks/rust/exercises/triangle/README.md +5 -4
- data/tracks/rust/exercises/variable-length-quantity/README.md +3 -2
- data/tracks/rust/exercises/word-count/README.md +3 -2
- data/tracks/rust/exercises/wordy/README.md +3 -2
- metadata +38 -3
- data/tracks/ecmascript/yarn.lock +0 -3144
@@ -48,14 +48,18 @@ let charToColor c =
|
|
48
48
|
| 'X' -> Some Black
|
49
49
|
| _ -> None
|
50
50
|
|
51
|
-
let
|
52
|
-
|
53
|
-
|
54
|
-
let
|
51
|
+
let normalizeRow (row: string) = row.Replace(" ", "")
|
52
|
+
|
53
|
+
let mkBoard (input: string list) =
|
54
|
+
let normalizedRows = List.map normalizeRow input
|
55
|
+
|
56
|
+
let rows' = List.length normalizedRows
|
57
|
+
let cols' = Seq.length (List.head normalizedRows)
|
58
|
+
let cellColor col row = normalizedRows |> List.item row |> Seq.item col |> charToColor
|
55
59
|
|
56
60
|
Array2D.init cols' rows' cellColor
|
57
61
|
|
58
|
-
let
|
62
|
+
let winner input =
|
59
63
|
let board = mkBoard input
|
60
64
|
if whiteWins board then Some White
|
61
65
|
elif blackWins board then Some Black
|
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
let joinBy str = List.reduce (fun x y -> x + str + y)
|
4
4
|
|
5
|
-
let verses = 8
|
6
|
-
|
7
5
|
let subjects =
|
8
6
|
[("spider", "It wriggled and jiggled and tickled inside her.");
|
9
7
|
("bird", "How absurd to swallow a bird!");
|
@@ -38,11 +36,9 @@ let verseEnd number =
|
|
38
36
|
|> List.skip (List.length history - number)
|
39
37
|
|> List.take number
|
40
38
|
|
41
|
-
let verse number =
|
42
|
-
verseBegin number @ verseEnd number
|
43
|
-
|> joinBy "\n"
|
39
|
+
let verse number = verseBegin number @ verseEnd number
|
44
40
|
|
45
|
-
let
|
46
|
-
[
|
47
|
-
|> List.map verse
|
48
|
-
|>
|
41
|
+
let verses start stop =
|
42
|
+
[start .. stop]
|
43
|
+
|> List.map verse
|
44
|
+
|> List.reduce (fun x y -> x @ "" :: y)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module FoodChain
|
2
2
|
|
3
|
-
let verse number = failwith "You need to implement this function."
|
3
|
+
let verse number: string list = failwith "You need to implement this function."
|
4
4
|
|
5
|
-
let
|
5
|
+
let verses start stop: string list = failwith "You need to implement this function."
|
@@ -1,97 +1,165 @@
|
|
1
|
+
// This file was auto-generated based on version 1.0.0 of the canonical data.
|
2
|
+
|
1
3
|
module FoodChainTest
|
2
4
|
|
3
|
-
open Xunit
|
4
5
|
open FsUnit.Xunit
|
6
|
+
open Xunit
|
5
7
|
|
6
8
|
open FoodChain
|
7
9
|
|
8
|
-
let combine = List.reduce (fun x y -> x + "\n" + y)
|
9
|
-
|
10
10
|
[<Fact>]
|
11
|
-
let ``
|
12
|
-
let expected =
|
13
|
-
|
14
|
-
|
11
|
+
let ``Fly`` () =
|
12
|
+
let expected =
|
13
|
+
[ "I know an old lady who swallowed a fly.";
|
14
|
+
"I don't know why she swallowed the fly. Perhaps she'll die." ]
|
15
15
|
verse 1 |> should equal expected
|
16
16
|
|
17
17
|
[<Fact(Skip = "Remove to run test")>]
|
18
|
-
let ``
|
19
|
-
let expected =
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
let ``Spider`` () =
|
19
|
+
let expected =
|
20
|
+
[ "I know an old lady who swallowed a spider.";
|
21
|
+
"It wriggled and jiggled and tickled inside her.";
|
22
|
+
"She swallowed the spider to catch the fly.";
|
23
|
+
"I don't know why she swallowed the fly. Perhaps she'll die." ]
|
24
24
|
verse 2 |> should equal expected
|
25
25
|
|
26
26
|
[<Fact(Skip = "Remove to run test")>]
|
27
|
-
let ``
|
28
|
-
let expected =
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
27
|
+
let ``Bird`` () =
|
28
|
+
let expected =
|
29
|
+
[ "I know an old lady who swallowed a bird.";
|
30
|
+
"How absurd to swallow a bird!";
|
31
|
+
"She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.";
|
32
|
+
"She swallowed the spider to catch the fly.";
|
33
|
+
"I don't know why she swallowed the fly. Perhaps she'll die." ]
|
34
|
+
verse 3 |> should equal expected
|
34
35
|
|
36
|
+
[<Fact(Skip = "Remove to run test")>]
|
37
|
+
let ``Cat`` () =
|
38
|
+
let expected =
|
39
|
+
[ "I know an old lady who swallowed a cat.";
|
40
|
+
"Imagine that, to swallow a cat!";
|
41
|
+
"She swallowed the cat to catch the bird.";
|
42
|
+
"She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.";
|
43
|
+
"She swallowed the spider to catch the fly.";
|
44
|
+
"I don't know why she swallowed the fly. Perhaps she'll die." ]
|
35
45
|
verse 4 |> should equal expected
|
36
46
|
|
37
47
|
[<Fact(Skip = "Remove to run test")>]
|
38
|
-
let ``
|
39
|
-
let expected =
|
40
|
-
|
48
|
+
let ``Dog`` () =
|
49
|
+
let expected =
|
50
|
+
[ "I know an old lady who swallowed a dog.";
|
51
|
+
"What a hog, to swallow a dog!";
|
52
|
+
"She swallowed the dog to catch the cat.";
|
53
|
+
"She swallowed the cat to catch the bird.";
|
54
|
+
"She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.";
|
55
|
+
"She swallowed the spider to catch the fly.";
|
56
|
+
"I don't know why she swallowed the fly. Perhaps she'll die." ]
|
57
|
+
verse 5 |> should equal expected
|
41
58
|
|
59
|
+
[<Fact(Skip = "Remove to run test")>]
|
60
|
+
let ``Goat`` () =
|
61
|
+
let expected =
|
62
|
+
[ "I know an old lady who swallowed a goat.";
|
63
|
+
"Just opened her throat and swallowed a goat!";
|
64
|
+
"She swallowed the goat to catch the dog.";
|
65
|
+
"She swallowed the dog to catch the cat.";
|
66
|
+
"She swallowed the cat to catch the bird.";
|
67
|
+
"She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.";
|
68
|
+
"She swallowed the spider to catch the fly.";
|
69
|
+
"I don't know why she swallowed the fly. Perhaps she'll die." ]
|
70
|
+
verse 6 |> should equal expected
|
71
|
+
|
72
|
+
[<Fact(Skip = "Remove to run test")>]
|
73
|
+
let ``Cow`` () =
|
74
|
+
let expected =
|
75
|
+
[ "I know an old lady who swallowed a cow.";
|
76
|
+
"I don't know how she swallowed a cow!";
|
77
|
+
"She swallowed the cow to catch the goat.";
|
78
|
+
"She swallowed the goat to catch the dog.";
|
79
|
+
"She swallowed the dog to catch the cat.";
|
80
|
+
"She swallowed the cat to catch the bird.";
|
81
|
+
"She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.";
|
82
|
+
"She swallowed the spider to catch the fly.";
|
83
|
+
"I don't know why she swallowed the fly. Perhaps she'll die." ]
|
84
|
+
verse 7 |> should equal expected
|
85
|
+
|
86
|
+
[<Fact(Skip = "Remove to run test")>]
|
87
|
+
let ``Horse`` () =
|
88
|
+
let expected =
|
89
|
+
[ "I know an old lady who swallowed a horse.";
|
90
|
+
"She's dead, of course!" ]
|
42
91
|
verse 8 |> should equal expected
|
43
92
|
|
44
93
|
[<Fact(Skip = "Remove to run test")>]
|
45
|
-
let ``
|
46
|
-
let expected =
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
94
|
+
let ``Multiple verses`` () =
|
95
|
+
let expected =
|
96
|
+
[ "I know an old lady who swallowed a fly.";
|
97
|
+
"I don't know why she swallowed the fly. Perhaps she'll die.";
|
98
|
+
"";
|
99
|
+
"I know an old lady who swallowed a spider.";
|
100
|
+
"It wriggled and jiggled and tickled inside her.";
|
101
|
+
"She swallowed the spider to catch the fly.";
|
102
|
+
"I don't know why she swallowed the fly. Perhaps she'll die.";
|
103
|
+
"";
|
104
|
+
"I know an old lady who swallowed a bird.";
|
105
|
+
"How absurd to swallow a bird!";
|
106
|
+
"She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.";
|
107
|
+
"She swallowed the spider to catch the fly.";
|
108
|
+
"I don't know why she swallowed the fly. Perhaps she'll die." ]
|
109
|
+
verses 1 3 |> should equal expected
|
110
|
+
|
111
|
+
[<Fact(Skip = "Remove to run test")>]
|
112
|
+
let ``Full song`` () =
|
113
|
+
let expected =
|
114
|
+
[ "I know an old lady who swallowed a fly.";
|
115
|
+
"I don't know why she swallowed the fly. Perhaps she'll die.";
|
116
|
+
"";
|
117
|
+
"I know an old lady who swallowed a spider.";
|
118
|
+
"It wriggled and jiggled and tickled inside her.";
|
119
|
+
"She swallowed the spider to catch the fly.";
|
120
|
+
"I don't know why she swallowed the fly. Perhaps she'll die.";
|
121
|
+
"";
|
122
|
+
"I know an old lady who swallowed a bird.";
|
123
|
+
"How absurd to swallow a bird!";
|
124
|
+
"She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.";
|
125
|
+
"She swallowed the spider to catch the fly.";
|
126
|
+
"I don't know why she swallowed the fly. Perhaps she'll die.";
|
127
|
+
"";
|
128
|
+
"I know an old lady who swallowed a cat.";
|
129
|
+
"Imagine that, to swallow a cat!";
|
130
|
+
"She swallowed the cat to catch the bird.";
|
131
|
+
"She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.";
|
132
|
+
"She swallowed the spider to catch the fly.";
|
133
|
+
"I don't know why she swallowed the fly. Perhaps she'll die.";
|
134
|
+
"";
|
135
|
+
"I know an old lady who swallowed a dog.";
|
136
|
+
"What a hog, to swallow a dog!";
|
137
|
+
"She swallowed the dog to catch the cat.";
|
138
|
+
"She swallowed the cat to catch the bird.";
|
139
|
+
"She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.";
|
140
|
+
"She swallowed the spider to catch the fly.";
|
141
|
+
"I don't know why she swallowed the fly. Perhaps she'll die.";
|
142
|
+
"";
|
143
|
+
"I know an old lady who swallowed a goat.";
|
144
|
+
"Just opened her throat and swallowed a goat!";
|
145
|
+
"She swallowed the goat to catch the dog.";
|
146
|
+
"She swallowed the dog to catch the cat.";
|
147
|
+
"She swallowed the cat to catch the bird.";
|
148
|
+
"She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.";
|
149
|
+
"She swallowed the spider to catch the fly.";
|
150
|
+
"I don't know why she swallowed the fly. Perhaps she'll die.";
|
151
|
+
"";
|
152
|
+
"I know an old lady who swallowed a cow.";
|
153
|
+
"I don't know how she swallowed a cow!";
|
154
|
+
"She swallowed the cow to catch the goat.";
|
155
|
+
"She swallowed the goat to catch the dog.";
|
156
|
+
"She swallowed the dog to catch the cat.";
|
157
|
+
"She swallowed the cat to catch the bird.";
|
158
|
+
"She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.";
|
159
|
+
"She swallowed the spider to catch the fly.";
|
160
|
+
"I don't know why she swallowed the fly. Perhaps she'll die.";
|
161
|
+
"";
|
162
|
+
"I know an old lady who swallowed a horse.";
|
163
|
+
"She's dead, of course!" ]
|
164
|
+
verses 1 8 |> should equal expected
|
96
165
|
|
97
|
-
song |> should equal expected
|
@@ -1,6 +1,10 @@
|
|
1
1
|
module Hamming
|
2
2
|
|
3
|
-
let
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
let distance (strand1:string) (strand2:string) =
|
4
|
+
if (strand1.Length <> strand2.Length) then
|
5
|
+
None
|
6
|
+
else
|
7
|
+
Array.zip (strand1.ToCharArray()) (strand2.ToCharArray())
|
8
|
+
|> Array.filter (fun (c1, c2) -> c1 <> c2)
|
9
|
+
|> Array.length
|
10
|
+
|> Some
|
@@ -1,29 +1,69 @@
|
|
1
|
+
// This file was auto-generated based on version 2.0.1 of the canonical data.
|
2
|
+
|
1
3
|
module HammingTest
|
2
4
|
|
3
|
-
open Xunit
|
4
5
|
open FsUnit.Xunit
|
6
|
+
open Xunit
|
7
|
+
|
5
8
|
open Hamming
|
6
9
|
|
7
10
|
[<Fact>]
|
8
|
-
let ``
|
9
|
-
|
11
|
+
let ``Empty strands`` () =
|
12
|
+
distance "" "" |> should equal (Some 0)
|
13
|
+
|
14
|
+
[<Fact(Skip = "Remove to run test")>]
|
15
|
+
let ``Identical strands`` () =
|
16
|
+
distance "A" "A" |> should equal (Some 0)
|
17
|
+
|
18
|
+
[<Fact(Skip = "Remove to run test")>]
|
19
|
+
let ``Long identical strands`` () =
|
20
|
+
distance "GGACTGA" "GGACTGA" |> should equal (Some 0)
|
21
|
+
|
22
|
+
[<Fact(Skip = "Remove to run test")>]
|
23
|
+
let ``Complete distance in single nucleotide strands`` () =
|
24
|
+
distance "A" "G" |> should equal (Some 1)
|
25
|
+
|
26
|
+
[<Fact(Skip = "Remove to run test")>]
|
27
|
+
let ``Complete distance in small strands`` () =
|
28
|
+
distance "AG" "CT" |> should equal (Some 2)
|
10
29
|
|
11
30
|
[<Fact(Skip = "Remove to run test")>]
|
12
|
-
let ``
|
13
|
-
|
31
|
+
let ``Small distance in small strands`` () =
|
32
|
+
distance "AT" "CT" |> should equal (Some 1)
|
14
33
|
|
15
34
|
[<Fact(Skip = "Remove to run test")>]
|
16
|
-
let ``
|
17
|
-
|
35
|
+
let ``Small distance`` () =
|
36
|
+
distance "GGACG" "GGTCG" |> should equal (Some 1)
|
18
37
|
|
19
38
|
[<Fact(Skip = "Remove to run test")>]
|
20
|
-
let ``
|
21
|
-
|
39
|
+
let ``Small distance in long strands`` () =
|
40
|
+
distance "ACCAGGG" "ACTATGG" |> should equal (Some 2)
|
22
41
|
|
23
42
|
[<Fact(Skip = "Remove to run test")>]
|
24
|
-
let ``
|
25
|
-
|
43
|
+
let ``Non-unique character in first strand`` () =
|
44
|
+
distance "AAG" "AAA" |> should equal (Some 1)
|
26
45
|
|
27
46
|
[<Fact(Skip = "Remove to run test")>]
|
28
|
-
let ``
|
29
|
-
|
47
|
+
let ``Non-unique character in second strand`` () =
|
48
|
+
distance "AAA" "AAG" |> should equal (Some 1)
|
49
|
+
|
50
|
+
[<Fact(Skip = "Remove to run test")>]
|
51
|
+
let ``Same nucleotides in different positions`` () =
|
52
|
+
distance "TAG" "GAT" |> should equal (Some 2)
|
53
|
+
|
54
|
+
[<Fact(Skip = "Remove to run test")>]
|
55
|
+
let ``Large distance`` () =
|
56
|
+
distance "GATACA" "GCATAA" |> should equal (Some 4)
|
57
|
+
|
58
|
+
[<Fact(Skip = "Remove to run test")>]
|
59
|
+
let ``Large distance in off-by-one strand`` () =
|
60
|
+
distance "GGACGGATTCTG" "AGGACGGATTCT" |> should equal (Some 9)
|
61
|
+
|
62
|
+
[<Fact(Skip = "Remove to run test")>]
|
63
|
+
let ``Disallow first strand longer`` () =
|
64
|
+
distance "AATG" "AAA" |> should equal None
|
65
|
+
|
66
|
+
[<Fact(Skip = "Remove to run test")>]
|
67
|
+
let ``Disallow second strand longer`` () =
|
68
|
+
distance "ATA" "AGTG" |> should equal None
|
69
|
+
|
@@ -23,13 +23,12 @@ let line number index =
|
|
23
23
|
if index = number then "This is the " + subject + ending
|
24
24
|
else "that " + verb + " the " + subject + ending
|
25
25
|
|
26
|
-
let
|
26
|
+
let verse number =
|
27
27
|
let lineForBlock = line number
|
28
28
|
[number .. -1 .. 1]
|
29
29
|
|> List.map lineForBlock
|
30
|
-
|> List.reduce (fun x y -> x + "\n" + y)
|
31
30
|
|
32
|
-
let
|
33
|
-
[
|
34
|
-
|> List.map
|
35
|
-
|> List.reduce (fun x y -> x
|
31
|
+
let verses startVerse endVerse =
|
32
|
+
[startVerse..endVerse]
|
33
|
+
|> List.map verse
|
34
|
+
|> List.reduce (fun x y -> x @ "" :: y)
|
@@ -1,103 +1,279 @@
|
|
1
|
+
// This file was auto-generated based on version 1.0.0 of the canonical data.
|
2
|
+
|
1
3
|
module HouseTest
|
2
4
|
|
3
|
-
open Xunit
|
4
5
|
open FsUnit.Xunit
|
6
|
+
open Xunit
|
5
7
|
|
6
8
|
open House
|
7
9
|
|
8
|
-
let expected =
|
9
|
-
[
|
10
|
-
"This is the house that Jack built.";
|
11
|
-
"";
|
12
|
-
"This is the malt";
|
13
|
-
"that lay in the house that Jack built.";
|
14
|
-
"";
|
15
|
-
"This is the rat";
|
16
|
-
"that ate the malt";
|
17
|
-
"that lay in the house that Jack built.";
|
18
|
-
"";
|
19
|
-
"This is the cat";
|
20
|
-
"that killed the rat";
|
21
|
-
"that ate the malt";
|
22
|
-
"that lay in the house that Jack built.";
|
23
|
-
"";
|
24
|
-
"This is the dog";
|
25
|
-
"that worried the cat";
|
26
|
-
"that killed the rat";
|
27
|
-
"that ate the malt";
|
28
|
-
"that lay in the house that Jack built.";
|
29
|
-
"";
|
30
|
-
"This is the cow with the crumpled horn";
|
31
|
-
"that tossed the dog";
|
32
|
-
"that worried the cat";
|
33
|
-
"that killed the rat";
|
34
|
-
"that ate the malt";
|
35
|
-
"that lay in the house that Jack built.";
|
36
|
-
"";
|
37
|
-
"This is the maiden all forlorn";
|
38
|
-
"that milked the cow with the crumpled horn";
|
39
|
-
"that tossed the dog";
|
40
|
-
"that worried the cat";
|
41
|
-
"that killed the rat";
|
42
|
-
"that ate the malt";
|
43
|
-
"that lay in the house that Jack built.";
|
44
|
-
"";
|
45
|
-
"This is the man all tattered and torn";
|
46
|
-
"that kissed the maiden all forlorn";
|
47
|
-
"that milked the cow with the crumpled horn";
|
48
|
-
"that tossed the dog";
|
49
|
-
"that worried the cat";
|
50
|
-
"that killed the rat";
|
51
|
-
"that ate the malt";
|
52
|
-
"that lay in the house that Jack built.";
|
53
|
-
"";
|
54
|
-
"This is the priest all shaven and shorn";
|
55
|
-
"that married the man all tattered and torn";
|
56
|
-
"that kissed the maiden all forlorn";
|
57
|
-
"that milked the cow with the crumpled horn";
|
58
|
-
"that tossed the dog";
|
59
|
-
"that worried the cat";
|
60
|
-
"that killed the rat";
|
61
|
-
"that ate the malt";
|
62
|
-
"that lay in the house that Jack built.";
|
63
|
-
"";
|
64
|
-
"This is the rooster that crowed in the morn";
|
65
|
-
"that woke the priest all shaven and shorn";
|
66
|
-
"that married the man all tattered and torn";
|
67
|
-
"that kissed the maiden all forlorn";
|
68
|
-
"that milked the cow with the crumpled horn";
|
69
|
-
"that tossed the dog";
|
70
|
-
"that worried the cat";
|
71
|
-
"that killed the rat";
|
72
|
-
"that ate the malt";
|
73
|
-
"that lay in the house that Jack built.";
|
74
|
-
"";
|
75
|
-
"This is the farmer sowing his corn";
|
76
|
-
"that kept the rooster that crowed in the morn";
|
77
|
-
"that woke the priest all shaven and shorn";
|
78
|
-
"that married the man all tattered and torn";
|
79
|
-
"that kissed the maiden all forlorn";
|
80
|
-
"that milked the cow with the crumpled horn";
|
81
|
-
"that tossed the dog";
|
82
|
-
"that worried the cat";
|
83
|
-
"that killed the rat";
|
84
|
-
"that ate the malt";
|
85
|
-
"that lay in the house that Jack built.";
|
86
|
-
"";
|
87
|
-
"This is the horse and the hound and the horn";
|
88
|
-
"that belonged to the farmer sowing his corn";
|
89
|
-
"that kept the rooster that crowed in the morn";
|
90
|
-
"that woke the priest all shaven and shorn";
|
91
|
-
"that married the man all tattered and torn";
|
92
|
-
"that kissed the maiden all forlorn";
|
93
|
-
"that milked the cow with the crumpled horn";
|
94
|
-
"that tossed the dog";
|
95
|
-
"that worried the cat";
|
96
|
-
"that killed the rat";
|
97
|
-
"that ate the malt";
|
98
|
-
"that lay in the house that Jack built."]
|
99
|
-
|> List.reduce (fun x y -> x + "\n" + y)
|
100
|
-
|
101
10
|
[<Fact>]
|
102
|
-
let ``
|
103
|
-
|
11
|
+
let ``Verse one - the house that jack built`` () =
|
12
|
+
let expected = ["This is the house that Jack built."]
|
13
|
+
verse 1 |> should equal expected
|
14
|
+
|
15
|
+
[<Fact(Skip = "Remove to run test")>]
|
16
|
+
let ``Verse two - the malt that lay`` () =
|
17
|
+
let expected =
|
18
|
+
[ "This is the malt"
|
19
|
+
"that lay in the house that Jack built." ]
|
20
|
+
verse 2 |> should equal expected
|
21
|
+
|
22
|
+
[<Fact(Skip = "Remove to run test")>]
|
23
|
+
let ``Verse three - the rat that ate`` () =
|
24
|
+
let expected =
|
25
|
+
[ "This is the rat"
|
26
|
+
"that ate the malt"
|
27
|
+
"that lay in the house that Jack built." ]
|
28
|
+
verse 3 |> should equal expected
|
29
|
+
|
30
|
+
[<Fact(Skip = "Remove to run test")>]
|
31
|
+
let ``Verse four - the cat that killed`` () =
|
32
|
+
let expected =
|
33
|
+
[ "This is the cat"
|
34
|
+
"that killed the rat"
|
35
|
+
"that ate the malt"
|
36
|
+
"that lay in the house that Jack built." ]
|
37
|
+
verse 4 |> should equal expected
|
38
|
+
|
39
|
+
[<Fact(Skip = "Remove to run test")>]
|
40
|
+
let ``Verse five - the dog that worried`` () =
|
41
|
+
let expected =
|
42
|
+
[ "This is the dog"
|
43
|
+
"that worried the cat"
|
44
|
+
"that killed the rat"
|
45
|
+
"that ate the malt"
|
46
|
+
"that lay in the house that Jack built." ]
|
47
|
+
verse 5 |> should equal expected
|
48
|
+
|
49
|
+
[<Fact(Skip = "Remove to run test")>]
|
50
|
+
let ``Verse six - the cow with the crumpled horn`` () =
|
51
|
+
let expected =
|
52
|
+
[ "This is the cow with the crumpled horn"
|
53
|
+
"that tossed the dog"
|
54
|
+
"that worried the cat"
|
55
|
+
"that killed the rat"
|
56
|
+
"that ate the malt"
|
57
|
+
"that lay in the house that Jack built." ]
|
58
|
+
verse 6 |> should equal expected
|
59
|
+
|
60
|
+
[<Fact(Skip = "Remove to run test")>]
|
61
|
+
let ``Verse seven - the maiden all forlorn`` () =
|
62
|
+
let expected =
|
63
|
+
[ "This is the maiden all forlorn"
|
64
|
+
"that milked the cow with the crumpled horn"
|
65
|
+
"that tossed the dog"
|
66
|
+
"that worried the cat"
|
67
|
+
"that killed the rat"
|
68
|
+
"that ate the malt"
|
69
|
+
"that lay in the house that Jack built." ]
|
70
|
+
verse 7 |> should equal expected
|
71
|
+
|
72
|
+
[<Fact(Skip = "Remove to run test")>]
|
73
|
+
let ``Verse eight - the man all tattered and torn`` () =
|
74
|
+
let expected =
|
75
|
+
[ "This is the man all tattered and torn"
|
76
|
+
"that kissed the maiden all forlorn"
|
77
|
+
"that milked the cow with the crumpled horn"
|
78
|
+
"that tossed the dog"
|
79
|
+
"that worried the cat"
|
80
|
+
"that killed the rat"
|
81
|
+
"that ate the malt"
|
82
|
+
"that lay in the house that Jack built." ]
|
83
|
+
verse 8 |> should equal expected
|
84
|
+
|
85
|
+
[<Fact(Skip = "Remove to run test")>]
|
86
|
+
let ``Verse nine - the priest all shaven and shorn`` () =
|
87
|
+
let expected =
|
88
|
+
[ "This is the priest all shaven and shorn"
|
89
|
+
"that married the man all tattered and torn"
|
90
|
+
"that kissed the maiden all forlorn"
|
91
|
+
"that milked the cow with the crumpled horn"
|
92
|
+
"that tossed the dog"
|
93
|
+
"that worried the cat"
|
94
|
+
"that killed the rat"
|
95
|
+
"that ate the malt"
|
96
|
+
"that lay in the house that Jack built." ]
|
97
|
+
verse 9 |> should equal expected
|
98
|
+
|
99
|
+
[<Fact(Skip = "Remove to run test")>]
|
100
|
+
let ``Verse 10 - the rooster that crowed in the morn`` () =
|
101
|
+
let expected =
|
102
|
+
[ "This is the rooster that crowed in the morn"
|
103
|
+
"that woke the priest all shaven and shorn"
|
104
|
+
"that married the man all tattered and torn"
|
105
|
+
"that kissed the maiden all forlorn"
|
106
|
+
"that milked the cow with the crumpled horn"
|
107
|
+
"that tossed the dog"
|
108
|
+
"that worried the cat"
|
109
|
+
"that killed the rat"
|
110
|
+
"that ate the malt"
|
111
|
+
"that lay in the house that Jack built." ]
|
112
|
+
verse 10 |> should equal expected
|
113
|
+
|
114
|
+
[<Fact(Skip = "Remove to run test")>]
|
115
|
+
let ``Verse 11 - the farmer sowing his corn`` () =
|
116
|
+
let expected =
|
117
|
+
[ "This is the farmer sowing his corn"
|
118
|
+
"that kept the rooster that crowed in the morn"
|
119
|
+
"that woke the priest all shaven and shorn"
|
120
|
+
"that married the man all tattered and torn"
|
121
|
+
"that kissed the maiden all forlorn"
|
122
|
+
"that milked the cow with the crumpled horn"
|
123
|
+
"that tossed the dog"
|
124
|
+
"that worried the cat"
|
125
|
+
"that killed the rat"
|
126
|
+
"that ate the malt"
|
127
|
+
"that lay in the house that Jack built." ]
|
128
|
+
verse 11 |> should equal expected
|
129
|
+
|
130
|
+
[<Fact(Skip = "Remove to run test")>]
|
131
|
+
let ``Verse 12 - the horse and the hound and the horn`` () =
|
132
|
+
let expected =
|
133
|
+
[ "This is the horse and the hound and the horn"
|
134
|
+
"that belonged to the farmer sowing his corn"
|
135
|
+
"that kept the rooster that crowed in the morn"
|
136
|
+
"that woke the priest all shaven and shorn"
|
137
|
+
"that married the man all tattered and torn"
|
138
|
+
"that kissed the maiden all forlorn"
|
139
|
+
"that milked the cow with the crumpled horn"
|
140
|
+
"that tossed the dog"
|
141
|
+
"that worried the cat"
|
142
|
+
"that killed the rat"
|
143
|
+
"that ate the malt"
|
144
|
+
"that lay in the house that Jack built." ]
|
145
|
+
verse 12 |> should equal expected
|
146
|
+
|
147
|
+
[<Fact(Skip = "Remove to run test")>]
|
148
|
+
let ``Multiple verses`` () =
|
149
|
+
let expected =
|
150
|
+
[ "This is the cat"
|
151
|
+
"that killed the rat"
|
152
|
+
"that ate the malt"
|
153
|
+
"that lay in the house that Jack built."
|
154
|
+
""
|
155
|
+
"This is the dog"
|
156
|
+
"that worried the cat"
|
157
|
+
"that killed the rat"
|
158
|
+
"that ate the malt"
|
159
|
+
"that lay in the house that Jack built."
|
160
|
+
""
|
161
|
+
"This is the cow with the crumpled horn"
|
162
|
+
"that tossed the dog"
|
163
|
+
"that worried the cat"
|
164
|
+
"that killed the rat"
|
165
|
+
"that ate the malt"
|
166
|
+
"that lay in the house that Jack built."
|
167
|
+
""
|
168
|
+
"This is the maiden all forlorn"
|
169
|
+
"that milked the cow with the crumpled horn"
|
170
|
+
"that tossed the dog"
|
171
|
+
"that worried the cat"
|
172
|
+
"that killed the rat"
|
173
|
+
"that ate the malt"
|
174
|
+
"that lay in the house that Jack built."
|
175
|
+
""
|
176
|
+
"This is the man all tattered and torn"
|
177
|
+
"that kissed the maiden all forlorn"
|
178
|
+
"that milked the cow with the crumpled horn"
|
179
|
+
"that tossed the dog"
|
180
|
+
"that worried the cat"
|
181
|
+
"that killed the rat"
|
182
|
+
"that ate the malt"
|
183
|
+
"that lay in the house that Jack built." ]
|
184
|
+
verses 4 8 |> should equal expected
|
185
|
+
|
186
|
+
[<Fact(Skip = "Remove to run test")>]
|
187
|
+
let ``Full rhyme`` () =
|
188
|
+
let expected =
|
189
|
+
[ "This is the house that Jack built."
|
190
|
+
""
|
191
|
+
"This is the malt"
|
192
|
+
"that lay in the house that Jack built."
|
193
|
+
""
|
194
|
+
"This is the rat"
|
195
|
+
"that ate the malt"
|
196
|
+
"that lay in the house that Jack built."
|
197
|
+
""
|
198
|
+
"This is the cat"
|
199
|
+
"that killed the rat"
|
200
|
+
"that ate the malt"
|
201
|
+
"that lay in the house that Jack built."
|
202
|
+
""
|
203
|
+
"This is the dog"
|
204
|
+
"that worried the cat"
|
205
|
+
"that killed the rat"
|
206
|
+
"that ate the malt"
|
207
|
+
"that lay in the house that Jack built."
|
208
|
+
""
|
209
|
+
"This is the cow with the crumpled horn"
|
210
|
+
"that tossed the dog"
|
211
|
+
"that worried the cat"
|
212
|
+
"that killed the rat"
|
213
|
+
"that ate the malt"
|
214
|
+
"that lay in the house that Jack built."
|
215
|
+
""
|
216
|
+
"This is the maiden all forlorn"
|
217
|
+
"that milked the cow with the crumpled horn"
|
218
|
+
"that tossed the dog"
|
219
|
+
"that worried the cat"
|
220
|
+
"that killed the rat"
|
221
|
+
"that ate the malt"
|
222
|
+
"that lay in the house that Jack built."
|
223
|
+
""
|
224
|
+
"This is the man all tattered and torn"
|
225
|
+
"that kissed the maiden all forlorn"
|
226
|
+
"that milked the cow with the crumpled horn"
|
227
|
+
"that tossed the dog"
|
228
|
+
"that worried the cat"
|
229
|
+
"that killed the rat"
|
230
|
+
"that ate the malt"
|
231
|
+
"that lay in the house that Jack built."
|
232
|
+
""
|
233
|
+
"This is the priest all shaven and shorn"
|
234
|
+
"that married the man all tattered and torn"
|
235
|
+
"that kissed the maiden all forlorn"
|
236
|
+
"that milked the cow with the crumpled horn"
|
237
|
+
"that tossed the dog"
|
238
|
+
"that worried the cat"
|
239
|
+
"that killed the rat"
|
240
|
+
"that ate the malt"
|
241
|
+
"that lay in the house that Jack built."
|
242
|
+
""
|
243
|
+
"This is the rooster that crowed in the morn"
|
244
|
+
"that woke the priest all shaven and shorn"
|
245
|
+
"that married the man all tattered and torn"
|
246
|
+
"that kissed the maiden all forlorn"
|
247
|
+
"that milked the cow with the crumpled horn"
|
248
|
+
"that tossed the dog"
|
249
|
+
"that worried the cat"
|
250
|
+
"that killed the rat"
|
251
|
+
"that ate the malt"
|
252
|
+
"that lay in the house that Jack built."
|
253
|
+
""
|
254
|
+
"This is the farmer sowing his corn"
|
255
|
+
"that kept the rooster that crowed in the morn"
|
256
|
+
"that woke the priest all shaven and shorn"
|
257
|
+
"that married the man all tattered and torn"
|
258
|
+
"that kissed the maiden all forlorn"
|
259
|
+
"that milked the cow with the crumpled horn"
|
260
|
+
"that tossed the dog"
|
261
|
+
"that worried the cat"
|
262
|
+
"that killed the rat"
|
263
|
+
"that ate the malt"
|
264
|
+
"that lay in the house that Jack built."
|
265
|
+
""
|
266
|
+
"This is the horse and the hound and the horn"
|
267
|
+
"that belonged to the farmer sowing his corn"
|
268
|
+
"that kept the rooster that crowed in the morn"
|
269
|
+
"that woke the priest all shaven and shorn"
|
270
|
+
"that married the man all tattered and torn"
|
271
|
+
"that kissed the maiden all forlorn"
|
272
|
+
"that milked the cow with the crumpled horn"
|
273
|
+
"that tossed the dog"
|
274
|
+
"that worried the cat"
|
275
|
+
"that killed the rat"
|
276
|
+
"that ate the malt"
|
277
|
+
"that lay in the house that Jack built." ]
|
278
|
+
verses 1 12 |> should equal expected
|
279
|
+
|