trackler 2.2.1.101 → 2.2.1.102
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/lib/trackler/version.rb +1 -1
- data/problem-specifications/exercises/protein-translation/description.md +2 -2
- data/problem-specifications/exercises/robot-simulator/canonical-data.json +27 -27
- data/problem-specifications/exercises/run-length-encoding/canonical-data.json +40 -14
- data/problem-specifications/exercises/tournament/canonical-data.json +71 -49
- data/tracks/bash/CONTRIBUTING.md +5 -10
- data/tracks/bash/POLICIES.md +57 -0
- data/tracks/bash/_template/example.sh +20 -1
- data/tracks/bash/exercises/hello-world/hello_world.sh +22 -0
- data/tracks/ceylon/exercises/anagram/source/anagram/AnagramTest.ceylon +1 -9
- data/tracks/ceylon/exercises/rna-transcription/README.md +1 -1
- data/tracks/fsharp/exercises/matrix/Example.fs +16 -13
- data/tracks/fsharp/exercises/matrix/Matrix.fs +2 -4
- data/tracks/fsharp/exercises/matrix/MatrixTest.fs +26 -67
- data/tracks/fsharp/exercises/saddle-points/Example.fs +19 -15
- data/tracks/fsharp/exercises/saddle-points/SaddlePointsTest.fs +31 -31
- data/tracks/fsharp/exercises/sublist/SublistTest.fs +71 -41
- data/tracks/fsharp/exercises/tournament/TournamentTest.fs +115 -48
- data/tracks/fsharp/exercises/transpose/Example.fs +10 -13
- data/tracks/fsharp/exercises/transpose/TransposeTest.fs +150 -219
- data/tracks/fsharp/generators/Generators.fs +55 -0
- data/tracks/go/exercises/clock/clock_test.go +1 -1
- data/tracks/go/exercises/poker/.meta/gen.go +5 -3
- data/tracks/go/exercises/poker/cases_test.go +2 -2
- data/tracks/go/exercises/prime-factors/.meta/gen.go +5 -3
- data/tracks/go/exercises/prime-factors/cases_test.go +2 -2
- data/tracks/go/exercises/rail-fence-cipher/.meta/gen.go +9 -7
- data/tracks/go/exercises/rail-fence-cipher/cases_test.go +2 -2
- data/tracks/go/exercises/raindrops/.meta/gen.go +4 -2
- data/tracks/go/exercises/raindrops/cases_test.go +2 -2
- data/tracks/go/exercises/reverse-string/.meta/gen.go +5 -3
- data/tracks/go/exercises/reverse-string/cases_test.go +2 -2
- data/tracks/go/exercises/rna-transcription/.meta/gen.go +11 -19
- data/tracks/go/exercises/rna-transcription/cases_test.go +20 -18
- data/tracks/go/exercises/rna-transcription/rna_transcription_test.go +3 -2
- data/tracks/go/exercises/run-length-encoding/.meta/gen.go +15 -9
- data/tracks/go/exercises/run-length-encoding/cases_test.go +2 -2
- data/tracks/go/exercises/sieve/.meta/gen.go +5 -3
- data/tracks/go/exercises/sieve/cases_test.go +2 -2
- data/tracks/go/exercises/space-age/.meta/gen.go +7 -5
- data/tracks/go/exercises/space-age/cases_test.go +2 -2
- data/tracks/go/exercises/sublist/.meta/gen.go +7 -5
- data/tracks/go/exercises/sublist/cases_test.go +2 -2
- data/tracks/go/exercises/variable-length-quantity/.meta/gen.go +7 -5
- data/tracks/go/exercises/variable-length-quantity/cases_test.go +2 -2
- data/tracks/haskell/exercises/rna-transcription/README.md +1 -1
- data/tracks/haskell/exercises/rna-transcription/package.yaml +1 -1
- data/tracks/haskell/exercises/rna-transcription/test/Tests.hs +12 -0
- data/tracks/javascript/.travis.yml +1 -1
- data/tracks/ruby/exercises/accumulate/.meta/hints.md +6 -3
- data/tracks/ruby/exercises/accumulate/README.md +6 -3
- metadata +4 -3
- data/tracks/fsharp/exercises/transpose/TrinaryTest.fs +0 -26
@@ -1,81 +1,111 @@
|
|
1
|
-
// This file was
|
1
|
+
// This file was auto-generated based on version 1.1.0 of the canonical data.
|
2
2
|
|
3
3
|
module SublistTest
|
4
4
|
|
5
|
-
open Xunit
|
6
5
|
open FsUnit.Xunit
|
6
|
+
open Xunit
|
7
7
|
|
8
8
|
open Sublist
|
9
9
|
|
10
10
|
[<Fact>]
|
11
|
-
let ``Empty
|
12
|
-
|
11
|
+
let ``Empty lists`` () =
|
12
|
+
let listOne = []
|
13
|
+
let listTwo = []
|
14
|
+
sublist listOne listTwo |> should equal Equal
|
13
15
|
|
14
16
|
[<Fact(Skip = "Remove to run test")>]
|
15
|
-
let ``Empty
|
16
|
-
|
17
|
+
let ``Empty list within non empty list`` () =
|
18
|
+
let listOne = []
|
19
|
+
let listTwo = [1; 2; 3]
|
20
|
+
sublist listOne listTwo |> should equal Sublist
|
17
21
|
|
18
22
|
[<Fact(Skip = "Remove to run test")>]
|
19
|
-
let ``
|
20
|
-
|
23
|
+
let ``Non empty list contains empty list`` () =
|
24
|
+
let listOne = [1; 2; 3]
|
25
|
+
let listTwo = []
|
26
|
+
sublist listOne listTwo |> should equal Superlist
|
21
27
|
|
22
28
|
[<Fact(Skip = "Remove to run test")>]
|
23
|
-
let ``
|
24
|
-
|
29
|
+
let ``List equals itself`` () =
|
30
|
+
let listOne = [1; 2; 3]
|
31
|
+
let listTwo = [1; 2; 3]
|
32
|
+
sublist listOne listTwo |> should equal Equal
|
25
33
|
|
26
34
|
[<Fact(Skip = "Remove to run test")>]
|
27
|
-
let ``
|
28
|
-
let
|
29
|
-
|
35
|
+
let ``Different lists`` () =
|
36
|
+
let listOne = [1; 2; 3]
|
37
|
+
let listTwo = [2; 3; 4]
|
38
|
+
sublist listOne listTwo |> should equal Unequal
|
30
39
|
|
31
40
|
[<Fact(Skip = "Remove to run test")>]
|
32
|
-
let ``
|
33
|
-
|
41
|
+
let ``False start`` () =
|
42
|
+
let listOne = [1; 2; 5]
|
43
|
+
let listTwo = [0; 1; 2; 3; 1; 2; 5; 6]
|
44
|
+
sublist listOne listTwo |> should equal Sublist
|
34
45
|
|
35
46
|
[<Fact(Skip = "Remove to run test")>]
|
36
|
-
let ``
|
37
|
-
|
47
|
+
let ``Consecutive`` () =
|
48
|
+
let listOne = [1; 1; 2]
|
49
|
+
let listTwo = [0; 1; 1; 1; 2; 1; 2]
|
50
|
+
sublist listOne listTwo |> should equal Sublist
|
38
51
|
|
39
52
|
[<Fact(Skip = "Remove to run test")>]
|
40
|
-
let ``Sublist at
|
41
|
-
|
53
|
+
let ``Sublist at start`` () =
|
54
|
+
let listOne = [0; 1; 2]
|
55
|
+
let listTwo = [0; 1; 2; 3; 4; 5]
|
56
|
+
sublist listOne listTwo |> should equal Sublist
|
42
57
|
|
43
58
|
[<Fact(Skip = "Remove to run test")>]
|
44
|
-
let ``
|
45
|
-
|
59
|
+
let ``Sublist in middle`` () =
|
60
|
+
let listOne = [2; 3; 4]
|
61
|
+
let listTwo = [0; 1; 2; 3; 4; 5]
|
62
|
+
sublist listOne listTwo |> should equal Sublist
|
46
63
|
|
47
64
|
[<Fact(Skip = "Remove to run test")>]
|
48
|
-
let ``Sublist
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
let ``Huge sublist not in huge list`` () =
|
53
|
-
sublist [10 .. 1000001] [1 .. 1000000] |> should equal Unequal
|
65
|
+
let ``Sublist at end`` () =
|
66
|
+
let listOne = [3; 4; 5]
|
67
|
+
let listTwo = [0; 1; 2; 3; 4; 5]
|
68
|
+
sublist listOne listTwo |> should equal Sublist
|
54
69
|
|
55
70
|
[<Fact(Skip = "Remove to run test")>]
|
56
|
-
let ``
|
57
|
-
|
71
|
+
let ``At start of superlist`` () =
|
72
|
+
let listOne = [0; 1; 2; 3; 4; 5]
|
73
|
+
let listTwo = [0; 1; 2]
|
74
|
+
sublist listOne listTwo |> should equal Superlist
|
58
75
|
|
59
76
|
[<Fact(Skip = "Remove to run test")>]
|
60
|
-
let ``
|
61
|
-
|
77
|
+
let ``In middle of superlist`` () =
|
78
|
+
let listOne = [0; 1; 2; 3; 4; 5]
|
79
|
+
let listTwo = [2; 3]
|
80
|
+
sublist listOne listTwo |> should equal Superlist
|
62
81
|
|
63
82
|
[<Fact(Skip = "Remove to run test")>]
|
64
|
-
let ``
|
65
|
-
|
83
|
+
let ``At end of superlist`` () =
|
84
|
+
let listOne = [0; 1; 2; 3; 4; 5]
|
85
|
+
let listTwo = [3; 4; 5]
|
86
|
+
sublist listOne listTwo |> should equal Superlist
|
66
87
|
|
67
88
|
[<Fact(Skip = "Remove to run test")>]
|
68
|
-
let ``
|
69
|
-
|
89
|
+
let ``First list missing element from second list`` () =
|
90
|
+
let listOne = [1; 3]
|
91
|
+
let listTwo = [1; 2; 3]
|
92
|
+
sublist listOne listTwo |> should equal Unequal
|
70
93
|
|
71
94
|
[<Fact(Skip = "Remove to run test")>]
|
72
|
-
let ``
|
73
|
-
|
95
|
+
let ``Second list missing element from first list`` () =
|
96
|
+
let listOne = [1; 2; 3]
|
97
|
+
let listTwo = [1; 3]
|
98
|
+
sublist listOne listTwo |> should equal Unequal
|
74
99
|
|
75
100
|
[<Fact(Skip = "Remove to run test")>]
|
76
|
-
let ``
|
77
|
-
|
101
|
+
let ``Order matters to a list`` () =
|
102
|
+
let listOne = [1; 2; 3]
|
103
|
+
let listTwo = [3; 2; 1]
|
104
|
+
sublist listOne listTwo |> should equal Unequal
|
78
105
|
|
79
106
|
[<Fact(Skip = "Remove to run test")>]
|
80
|
-
let ``
|
81
|
-
|
107
|
+
let ``Same digits but different numbers`` () =
|
108
|
+
let listOne = [1; 0; 1]
|
109
|
+
let listTwo = [10; 1]
|
110
|
+
sublist listOne listTwo |> should equal Unequal
|
111
|
+
|
@@ -1,68 +1,135 @@
|
|
1
|
-
// This file was
|
1
|
+
// This file was auto-generated based on version 1.4.0 of the canonical data.
|
2
2
|
|
3
3
|
module TournamentTest
|
4
|
-
|
5
|
-
open Xunit
|
4
|
+
|
6
5
|
open FsUnit.Xunit
|
6
|
+
open Xunit
|
7
7
|
|
8
8
|
open Tournament
|
9
9
|
|
10
10
|
[<Fact>]
|
11
|
-
let ``
|
12
|
-
let
|
13
|
-
|
14
|
-
|
15
|
-
"Devastating Donkeys;Αllegoric Alaskians;win";
|
16
|
-
"Courageous Californians;Blithering Badgers;loss";
|
17
|
-
"Blithering Badgers;Devastating Donkeys;loss";
|
18
|
-
"Αllegoric Alaskians;Courageous Californians;win"]
|
11
|
+
let ``Just the header if no input`` () =
|
12
|
+
let rows = []
|
13
|
+
let expected = ["Team | MP | W | D | L | P"]
|
14
|
+
tally rows |> should equal expected
|
19
15
|
|
16
|
+
[<Fact(Skip = "Remove to run test")>]
|
17
|
+
let ``A win is three points, a loss is zero points`` () =
|
18
|
+
let rows = ["Allegoric Alaskans;Blithering Badgers;win"]
|
20
19
|
let expected =
|
21
|
-
["Team | MP | W | D | L | P";
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
"Courageous Californians | 3 | 0 | 1 | 2 | 1"]
|
20
|
+
[ "Team | MP | W | D | L | P";
|
21
|
+
"Allegoric Alaskans | 1 | 1 | 0 | 0 | 3";
|
22
|
+
"Blithering Badgers | 1 | 0 | 0 | 1 | 0" ]
|
23
|
+
tally rows |> should equal expected
|
26
24
|
|
27
|
-
|
25
|
+
[<Fact(Skip = "Remove to run test")>]
|
26
|
+
let ``A win can also be expressed as a loss`` () =
|
27
|
+
let rows = ["Blithering Badgers;Allegoric Alaskans;loss"]
|
28
|
+
let expected =
|
29
|
+
[ "Team | MP | W | D | L | P";
|
30
|
+
"Allegoric Alaskans | 1 | 1 | 0 | 0 | 3";
|
31
|
+
"Blithering Badgers | 1 | 0 | 0 | 1 | 0" ]
|
32
|
+
tally rows |> should equal expected
|
28
33
|
|
29
34
|
[<Fact(Skip = "Remove to run test")>]
|
30
|
-
let ``
|
31
|
-
let
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
"Bla;Bla;Bla";
|
38
|
-
"Blithering Badgers;Devastating Donkeys;loss";
|
39
|
-
"# Yackity yackity yack";
|
40
|
-
"Allegoric Alaskians;Courageous Californians;win";
|
41
|
-
"Devastating Donkeys;Courageous Californians;draw";
|
42
|
-
"Devastating Donkeys@Courageous Californians;draw"]
|
35
|
+
let ``A different team can win`` () =
|
36
|
+
let rows = ["Blithering Badgers;Allegoric Alaskans;win"]
|
37
|
+
let expected =
|
38
|
+
[ "Team | MP | W | D | L | P";
|
39
|
+
"Blithering Badgers | 1 | 1 | 0 | 0 | 3";
|
40
|
+
"Allegoric Alaskans | 1 | 0 | 0 | 1 | 0" ]
|
41
|
+
tally rows |> should equal expected
|
43
42
|
|
43
|
+
[<Fact(Skip = "Remove to run test")>]
|
44
|
+
let ``A draw is one point each`` () =
|
45
|
+
let rows = ["Allegoric Alaskans;Blithering Badgers;draw"]
|
44
46
|
let expected =
|
45
|
-
["Team | MP | W | D | L | P";
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
"Courageous Californians | 3 | 0 | 1 | 2 | 1"]
|
47
|
+
[ "Team | MP | W | D | L | P";
|
48
|
+
"Allegoric Alaskans | 1 | 0 | 1 | 0 | 1";
|
49
|
+
"Blithering Badgers | 1 | 0 | 1 | 0 | 1" ]
|
50
|
+
tally rows |> should equal expected
|
50
51
|
|
51
|
-
|
52
|
+
[<Fact(Skip = "Remove to run test")>]
|
53
|
+
let ``There can be more than one match`` () =
|
54
|
+
let rows =
|
55
|
+
[ "Allegoric Alaskans;Blithering Badgers;win";
|
56
|
+
"Allegoric Alaskans;Blithering Badgers;win" ]
|
57
|
+
let expected =
|
58
|
+
[ "Team | MP | W | D | L | P";
|
59
|
+
"Allegoric Alaskans | 2 | 2 | 0 | 0 | 6";
|
60
|
+
"Blithering Badgers | 2 | 0 | 0 | 2 | 0" ]
|
61
|
+
tally rows |> should equal expected
|
52
62
|
|
53
63
|
[<Fact(Skip = "Remove to run test")>]
|
54
|
-
let ``
|
55
|
-
let
|
56
|
-
["Allegoric
|
57
|
-
|
58
|
-
|
59
|
-
|
64
|
+
let ``There can be more than one winner`` () =
|
65
|
+
let rows =
|
66
|
+
[ "Allegoric Alaskans;Blithering Badgers;loss";
|
67
|
+
"Allegoric Alaskans;Blithering Badgers;win" ]
|
68
|
+
let expected =
|
69
|
+
[ "Team | MP | W | D | L | P";
|
70
|
+
"Allegoric Alaskans | 2 | 1 | 0 | 1 | 3";
|
71
|
+
"Blithering Badgers | 2 | 1 | 0 | 1 | 3" ]
|
72
|
+
tally rows |> should equal expected
|
60
73
|
|
74
|
+
[<Fact(Skip = "Remove to run test")>]
|
75
|
+
let ``There can be more than two teams`` () =
|
76
|
+
let rows =
|
77
|
+
[ "Allegoric Alaskans;Blithering Badgers;win";
|
78
|
+
"Blithering Badgers;Courageous Californians;win";
|
79
|
+
"Courageous Californians;Allegoric Alaskans;loss" ]
|
80
|
+
let expected =
|
81
|
+
[ "Team | MP | W | D | L | P";
|
82
|
+
"Allegoric Alaskans | 2 | 2 | 0 | 0 | 6";
|
83
|
+
"Blithering Badgers | 2 | 1 | 0 | 1 | 3";
|
84
|
+
"Courageous Californians | 2 | 0 | 0 | 2 | 0" ]
|
85
|
+
tally rows |> should equal expected
|
86
|
+
|
87
|
+
[<Fact(Skip = "Remove to run test")>]
|
88
|
+
let ``Typical input`` () =
|
89
|
+
let rows =
|
90
|
+
[ "Allegoric Alaskans;Blithering Badgers;win";
|
91
|
+
"Devastating Donkeys;Courageous Californians;draw";
|
92
|
+
"Devastating Donkeys;Allegoric Alaskans;win";
|
93
|
+
"Courageous Californians;Blithering Badgers;loss";
|
94
|
+
"Blithering Badgers;Devastating Donkeys;loss";
|
95
|
+
"Allegoric Alaskans;Courageous Californians;win" ]
|
96
|
+
let expected =
|
97
|
+
[ "Team | MP | W | D | L | P";
|
98
|
+
"Devastating Donkeys | 3 | 2 | 1 | 0 | 7";
|
99
|
+
"Allegoric Alaskans | 3 | 2 | 0 | 1 | 6";
|
100
|
+
"Blithering Badgers | 3 | 1 | 0 | 2 | 3";
|
101
|
+
"Courageous Californians | 3 | 0 | 1 | 2 | 1" ]
|
102
|
+
tally rows |> should equal expected
|
103
|
+
|
104
|
+
[<Fact(Skip = "Remove to run test")>]
|
105
|
+
let ``Incomplete competition (not all pairs have played)`` () =
|
106
|
+
let rows =
|
107
|
+
[ "Allegoric Alaskans;Blithering Badgers;loss";
|
108
|
+
"Devastating Donkeys;Allegoric Alaskans;loss";
|
109
|
+
"Courageous Californians;Blithering Badgers;draw";
|
110
|
+
"Allegoric Alaskans;Courageous Californians;win" ]
|
111
|
+
let expected =
|
112
|
+
[ "Team | MP | W | D | L | P";
|
113
|
+
"Allegoric Alaskans | 3 | 2 | 0 | 1 | 6";
|
114
|
+
"Blithering Badgers | 2 | 1 | 1 | 0 | 4";
|
115
|
+
"Courageous Californians | 2 | 0 | 1 | 1 | 1";
|
116
|
+
"Devastating Donkeys | 1 | 0 | 0 | 1 | 0" ]
|
117
|
+
tally rows |> should equal expected
|
118
|
+
|
119
|
+
[<Fact(Skip = "Remove to run test")>]
|
120
|
+
let ``Ties broken alphabetically`` () =
|
121
|
+
let rows =
|
122
|
+
[ "Courageous Californians;Devastating Donkeys;win";
|
123
|
+
"Allegoric Alaskans;Blithering Badgers;win";
|
124
|
+
"Devastating Donkeys;Allegoric Alaskans;loss";
|
125
|
+
"Courageous Californians;Blithering Badgers;win";
|
126
|
+
"Blithering Badgers;Devastating Donkeys;draw";
|
127
|
+
"Allegoric Alaskans;Courageous Californians;draw" ]
|
61
128
|
let expected =
|
62
|
-
["Team | MP | W | D | L | P";
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
129
|
+
[ "Team | MP | W | D | L | P";
|
130
|
+
"Allegoric Alaskans | 3 | 2 | 1 | 0 | 7";
|
131
|
+
"Courageous Californians | 3 | 2 | 1 | 0 | 7";
|
132
|
+
"Blithering Badgers | 3 | 0 | 1 | 2 | 1";
|
133
|
+
"Devastating Donkeys | 3 | 0 | 1 | 2 | 1" ]
|
134
|
+
tally rows |> should equal expected
|
67
135
|
|
68
|
-
tally actual |> should equal expected
|
@@ -1,29 +1,26 @@
|
|
1
1
|
module Transpose
|
2
2
|
|
3
|
-
let transpose (
|
4
|
-
let rows = input.Split '\n'
|
5
|
-
|
3
|
+
let transpose (rows: string list): string list =
|
6
4
|
let transposedCoordinates =
|
7
5
|
rows
|
8
|
-
|>
|
9
|
-
|>
|
6
|
+
|> List.mapi (fun row str -> str |> Seq.mapi (fun col char -> (col, (row, char))) |> List.ofSeq)
|
7
|
+
|> List.concat
|
10
8
|
|
11
9
|
let groupedByTransposedColumns =
|
12
10
|
transposedCoordinates
|
13
|
-
|>
|
14
|
-
|>
|
11
|
+
|> List.groupBy fst
|
12
|
+
|> List.map (fun (row, chars) -> (row, chars |> List.map snd))
|
15
13
|
|
16
|
-
let transposedColToRow (input: (int * char)
|
17
|
-
let maxCol = input |>
|
14
|
+
let transposedColToRow (input: (int * char) list) =
|
15
|
+
let maxCol = input |> List.map fst |> List.max
|
18
16
|
let findCharacter col =
|
19
|
-
match
|
17
|
+
match List.tryFind (fun (c, _) -> c = col) input with
|
20
18
|
| Some y -> snd y
|
21
19
|
| None -> ' '
|
22
|
-
|
20
|
+
|
23
21
|
[| 0..maxCol |]
|
24
22
|
|> Array.map findCharacter
|
25
23
|
|> System.String
|
26
24
|
|
27
25
|
groupedByTransposedColumns
|
28
|
-
|>
|
29
|
-
|> String.concat "\n"
|
26
|
+
|> List.map (snd >> transposedColToRow)
|
@@ -1,256 +1,187 @@
|
|
1
|
-
// This file was
|
1
|
+
// This file was auto-generated based on version 1.1.0 of the canonical data.
|
2
2
|
|
3
3
|
module TransposeTest
|
4
4
|
|
5
|
-
open Xunit
|
6
5
|
open FsUnit.Xunit
|
6
|
+
open Xunit
|
7
7
|
|
8
8
|
open Transpose
|
9
9
|
|
10
10
|
[<Fact>]
|
11
|
-
let ``Empty string`` () =
|
12
|
-
let
|
13
|
-
let expected =
|
14
|
-
|
15
|
-
transpose input |> should equal expected
|
11
|
+
let ``Empty string`` () =
|
12
|
+
let lines: string list = []
|
13
|
+
let expected: string list = []
|
14
|
+
transpose lines |> should equal expected
|
16
15
|
|
17
16
|
[<Fact(Skip = "Remove to run test")>]
|
18
|
-
let ``Two characters in a row`` () =
|
19
|
-
let
|
20
|
-
"A1"
|
21
|
-
|
17
|
+
let ``Two characters in a row`` () =
|
18
|
+
let lines = ["A1"]
|
22
19
|
let expected =
|
23
|
-
"A
|
24
|
-
|
25
|
-
|
26
|
-
transpose input |> should equal expected
|
20
|
+
[ "A";
|
21
|
+
"1" ]
|
22
|
+
transpose lines |> should equal expected
|
27
23
|
|
28
24
|
[<Fact(Skip = "Remove to run test")>]
|
29
|
-
let ``Two characters in a column`` () =
|
30
|
-
let
|
31
|
-
"A
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
"A1"
|
36
|
-
|
37
|
-
transpose input |> should equal expected
|
25
|
+
let ``Two characters in a column`` () =
|
26
|
+
let lines =
|
27
|
+
[ "A";
|
28
|
+
"1" ]
|
29
|
+
let expected = ["A1"]
|
30
|
+
transpose lines |> should equal expected
|
38
31
|
|
39
32
|
[<Fact(Skip = "Remove to run test")>]
|
40
|
-
let ``Simple`` () =
|
41
|
-
let
|
42
|
-
"ABC
|
43
|
-
|
44
|
-
|
33
|
+
let ``Simple`` () =
|
34
|
+
let lines =
|
35
|
+
[ "ABC";
|
36
|
+
"123" ]
|
45
37
|
let expected =
|
46
|
-
"A1
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
transpose input |> should equal expected
|
38
|
+
[ "A1";
|
39
|
+
"B2";
|
40
|
+
"C3" ]
|
41
|
+
transpose lines |> should equal expected
|
51
42
|
|
52
43
|
[<Fact(Skip = "Remove to run test")>]
|
53
|
-
let ``Single line`` () =
|
54
|
-
let
|
55
|
-
"Single line."
|
56
|
-
|
44
|
+
let ``Single line`` () =
|
45
|
+
let lines = ["Single line."]
|
57
46
|
let expected =
|
58
|
-
"S
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
transpose input |> should equal expected
|
47
|
+
[ "S";
|
48
|
+
"i";
|
49
|
+
"n";
|
50
|
+
"g";
|
51
|
+
"l";
|
52
|
+
"e";
|
53
|
+
" ";
|
54
|
+
"l";
|
55
|
+
"i";
|
56
|
+
"n";
|
57
|
+
"e";
|
58
|
+
"." ]
|
59
|
+
transpose lines |> should equal expected
|
72
60
|
|
73
61
|
[<Fact(Skip = "Remove to run test")>]
|
74
|
-
let ``First line longer than second line`` () =
|
75
|
-
let
|
76
|
-
"The fourth line
|
77
|
-
|
78
|
-
|
62
|
+
let ``First line longer than second line`` () =
|
63
|
+
let lines =
|
64
|
+
[ "The fourth line.";
|
65
|
+
"The fifth line." ]
|
79
66
|
let expected =
|
80
|
-
"TT
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
transpose input |> should equal expected
|
67
|
+
[ "TT";
|
68
|
+
"hh";
|
69
|
+
"ee";
|
70
|
+
" ";
|
71
|
+
"ff";
|
72
|
+
"oi";
|
73
|
+
"uf";
|
74
|
+
"rt";
|
75
|
+
"th";
|
76
|
+
"h ";
|
77
|
+
" l";
|
78
|
+
"li";
|
79
|
+
"in";
|
80
|
+
"ne";
|
81
|
+
"e.";
|
82
|
+
"." ]
|
83
|
+
transpose lines |> should equal expected
|
98
84
|
|
99
85
|
[<Fact(Skip = "Remove to run test")>]
|
100
|
-
let ``Second line longer than first line`` () =
|
101
|
-
let
|
102
|
-
"The first line
|
103
|
-
|
104
|
-
|
86
|
+
let ``Second line longer than first line`` () =
|
87
|
+
let lines =
|
88
|
+
[ "The first line.";
|
89
|
+
"The second line." ]
|
105
90
|
let expected =
|
106
|
-
"TT
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
transpose input |> should equal expected
|
91
|
+
[ "TT";
|
92
|
+
"hh";
|
93
|
+
"ee";
|
94
|
+
" ";
|
95
|
+
"fs";
|
96
|
+
"ie";
|
97
|
+
"rc";
|
98
|
+
"so";
|
99
|
+
"tn";
|
100
|
+
" d";
|
101
|
+
"l ";
|
102
|
+
"il";
|
103
|
+
"ni";
|
104
|
+
"en";
|
105
|
+
".e";
|
106
|
+
" ." ]
|
107
|
+
transpose lines |> should equal expected
|
124
108
|
|
125
109
|
[<Fact(Skip = "Remove to run test")>]
|
126
|
-
let ``
|
127
|
-
let
|
128
|
-
"
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
"TREND"
|
133
|
-
|
110
|
+
let ``Mixed line length`` () =
|
111
|
+
let lines =
|
112
|
+
[ "The longest line.";
|
113
|
+
"A long line.";
|
114
|
+
"A longer line.";
|
115
|
+
"A line." ]
|
134
116
|
let expected =
|
135
|
-
"
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
117
|
+
[ "TAAA";
|
118
|
+
"h ";
|
119
|
+
"elll";
|
120
|
+
" ooi";
|
121
|
+
"lnnn";
|
122
|
+
"ogge";
|
123
|
+
"n e.";
|
124
|
+
"glr";
|
125
|
+
"ei ";
|
126
|
+
"snl";
|
127
|
+
"tei";
|
128
|
+
" .n";
|
129
|
+
"l e";
|
130
|
+
"i .";
|
131
|
+
"n";
|
132
|
+
"e";
|
133
|
+
"." ]
|
134
|
+
transpose lines |> should equal expected
|
142
135
|
|
143
136
|
[<Fact(Skip = "Remove to run test")>]
|
144
|
-
let ``
|
145
|
-
let
|
146
|
-
"
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
137
|
+
let ``Square`` () =
|
138
|
+
let lines =
|
139
|
+
[ "HEART";
|
140
|
+
"EMBER";
|
141
|
+
"ABUSE";
|
142
|
+
"RESIN";
|
143
|
+
"TREND" ]
|
151
144
|
let expected =
|
152
|
-
"
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
"RENT\n"+
|
159
|
-
"EDGE"
|
160
|
-
|
161
|
-
transpose input |> should equal expected
|
145
|
+
[ "HEART";
|
146
|
+
"EMBER";
|
147
|
+
"ABUSE";
|
148
|
+
"RESIN";
|
149
|
+
"TREND" ]
|
150
|
+
transpose lines |> should equal expected
|
162
151
|
|
163
152
|
[<Fact(Skip = "Remove to run test")>]
|
164
|
-
let ``
|
165
|
-
let
|
166
|
-
"
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
"EEEEE\n" +
|
171
|
-
"RRRRRR"
|
172
|
-
|
153
|
+
let ``Rectangle`` () =
|
154
|
+
let lines =
|
155
|
+
[ "FRACTURE";
|
156
|
+
"OUTLINED";
|
157
|
+
"BLOOMING";
|
158
|
+
"SEPTETTE" ]
|
173
159
|
let expected =
|
174
|
-
"
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
160
|
+
[ "FOBS";
|
161
|
+
"RULE";
|
162
|
+
"ATOP";
|
163
|
+
"CLOT";
|
164
|
+
"TIME";
|
165
|
+
"UNIT";
|
166
|
+
"RENT";
|
167
|
+
"EDGE" ]
|
168
|
+
transpose lines |> should equal expected
|
182
169
|
|
183
170
|
[<Fact(Skip = "Remove to run test")>]
|
184
|
-
let ``
|
185
|
-
let
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
171
|
+
let ``Triangle`` () =
|
172
|
+
let lines =
|
173
|
+
[ "T";
|
174
|
+
"EE";
|
175
|
+
"AAA";
|
176
|
+
"SSSS";
|
177
|
+
"EEEEE";
|
178
|
+
"RRRRRR" ]
|
179
|
+
let expected =
|
180
|
+
[ "TEASER";
|
181
|
+
" EASER";
|
182
|
+
" ASER";
|
183
|
+
" SER";
|
184
|
+
" ER";
|
185
|
+
" R" ]
|
186
|
+
transpose lines |> should equal expected
|
200
187
|
|
201
|
-
let expected =
|
202
|
-
"CIFWFAWDTAWITW\n" +
|
203
|
-
"hnrhr hohnhshh\n" +
|
204
|
-
"o oeopotedi ea\n" +
|
205
|
-
"rfmrmash cn t\n" +
|
206
|
-
".a e ie fthow \n" +
|
207
|
-
" ia fr weh,whh\n" +
|
208
|
-
"Trnco miae ie\n" +
|
209
|
-
"w ciroitr btcr\n" +
|
210
|
-
"oVivtfshfcuhhe\n" +
|
211
|
-
" eeih a uote \n" +
|
212
|
-
"hrnl sdtln is\n" +
|
213
|
-
"oot ttvh tttfh\n" +
|
214
|
-
"un bhaeepihw a\n" +
|
215
|
-
"saglernianeoyl\n" +
|
216
|
-
"e,ro -trsui ol\n" +
|
217
|
-
"h uofcu sarhu \n" +
|
218
|
-
"owddarrdan o m\n" +
|
219
|
-
"lhg to'egccuwi\n" +
|
220
|
-
"deemasdaeehris\n" +
|
221
|
-
"sr als t ists\n" +
|
222
|
-
",ebk 'phool'h,\n" +
|
223
|
-
" reldi ffd \n" +
|
224
|
-
"bweso tb rtpo\n" +
|
225
|
-
"oea ileutterau\n" +
|
226
|
-
"t kcnoorhhnatr\n" +
|
227
|
-
"hl isvuyee'fi \n" +
|
228
|
-
" atv es iisfet\n" +
|
229
|
-
"ayoior trr ino\n" +
|
230
|
-
"l lfsoh ecti\n" +
|
231
|
-
"ion vedpn l\n" +
|
232
|
-
"kuehtteieadoe \n" +
|
233
|
-
"erwaharrar,fas\n" +
|
234
|
-
" nekt te rh\n" +
|
235
|
-
"ismdsehphnnosa\n" +
|
236
|
-
"ncuse ra-tau l\n" +
|
237
|
-
" et tormsural\n" +
|
238
|
-
"dniuthwea'g t \n" +
|
239
|
-
"iennwesnr hsts\n" +
|
240
|
-
"g,ycoi tkrttet\n" +
|
241
|
-
"n ,l r s'a anr\n" +
|
242
|
-
"i ef 'dgcgdi\n" +
|
243
|
-
"t aol eoe,v\n" +
|
244
|
-
"y nei sl,u; e\n" +
|
245
|
-
", .sf to l \n" +
|
246
|
-
" e rv d t\n" +
|
247
|
-
" ; ie o\n" +
|
248
|
-
" f, r \n" +
|
249
|
-
" e e m\n" +
|
250
|
-
" . m e\n" +
|
251
|
-
" o n\n" +
|
252
|
-
" v d\n" +
|
253
|
-
" e .\n" +
|
254
|
-
" ,"
|
255
|
-
|
256
|
-
transpose input |> should equal expected
|