trackler 2.2.1.138 → 2.2.1.139
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/crypto-square/description.md +23 -19
- data/problem-specifications/exercises/yacht/canonical-data.json +10 -1
- data/tracks/clojure/exercises/gigasecond/src/gigasecond.clj +5 -0
- data/tracks/clojure/exercises/grade-school/src/grade_school.clj +13 -0
- data/tracks/clojure/exercises/grains/src/grains.clj +9 -0
- data/tracks/clojure/exercises/minesweeper/src/minesweeper.clj +5 -0
- data/tracks/fsharp/docs/GENERATORS.md +12 -14
- data/tracks/fsharp/exercises/bowling/BowlingTest.fs +15 -15
- data/tracks/fsharp/exercises/perfect-numbers/PerfectNumbersTest.fs +11 -11
- data/tracks/fsharp/exercises/rna-transcription/Example.fs +7 -15
- data/tracks/fsharp/exercises/rna-transcription/RnaTranscription.fs +1 -1
- data/tracks/fsharp/exercises/rna-transcription/RnaTranscriptionTest.fs +5 -5
- data/tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs +34 -34
- data/tracks/fsharp/exercises/sublist/Example.fs +1 -1
- data/tracks/fsharp/exercises/sublist/Sublist.fs +1 -1
- data/tracks/fsharp/exercises/sublist/SublistTest.fs +17 -17
- data/tracks/fsharp/exercises/word-search/WordSearchTest.fs +56 -57
- data/tracks/fsharp/generators/CanonicalData.fs +14 -15
- data/tracks/fsharp/generators/Common.fs +4 -84
- data/tracks/fsharp/generators/Conversion.fs +75 -0
- data/tracks/fsharp/generators/Exercise.fs +15 -11
- data/tracks/fsharp/generators/Generators.fs +294 -468
- data/tracks/fsharp/generators/Generators.fsproj +2 -1
- data/tracks/fsharp/generators/Rendering.fs +169 -61
- data/tracks/fsharp/generators/Templates.fs +64 -0
- data/tracks/fsharp/generators/Track.fs +3 -3
- data/tracks/idris/exercises/accumulate/src/Example.idr +1 -1
- data/tracks/idris/exercises/accumulate/src/Test/Accumulate.idr +2 -2
- data/tracks/java/exercises/rna-transcription/.meta/hints.md +2 -0
- data/tracks/java/exercises/rna-transcription/README.md +6 -0
- data/tracks/nim/.gitignore +1 -0
- data/tracks/nim/config.json +38 -0
- data/tracks/nim/config/maintainers.json +10 -0
- data/tracks/nim/docs/ABOUT.md +7 -0
- data/tracks/nim/exercises/bob/README.md +2 -0
- data/tracks/nim/exercises/bob/bob_test.nim +31 -13
- data/tracks/nim/exercises/bob/example.nim +2 -2
- data/tracks/nim/exercises/gigasecond/README.md +22 -0
- data/tracks/nim/exercises/gigasecond/example.nim +4 -0
- data/tracks/nim/exercises/gigasecond/gigasecond_test.nim +32 -0
- data/tracks/nim/exercises/isogram/README.md +20 -0
- data/tracks/nim/exercises/isogram/example.nim +6 -0
- data/tracks/nim/exercises/isogram/isogram_test.nim +32 -0
- data/tracks/nim/exercises/space-age/README.md +24 -0
- data/tracks/nim/exercises/space-age/example.nim +17 -0
- data/tracks/nim/exercises/space-age/space_age_test.nim +29 -0
- data/tracks/nim/exercises/triangle/example.nim +22 -22
- data/tracks/nim/exercises/triangle/triangle_test.nim +32 -44
- metadata +19 -3
- data/tracks/fsharp/generators/Formatting.fs +0 -189
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b48b5f9ad4c3dda8082d4ec68ca569b6f58bcd9e
|
4
|
+
data.tar.gz: 906a0b93107cfb896d1683e08fd1de2bfb139d4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 061ee013f6f779604520690a10c22a0b1009322a215cef3f0143753bfe18820fa0f4023c608835db4c587ea4839a2836eb314cf6ca04be928587861e3af1b1e4
|
7
|
+
data.tar.gz: b35bb468ad872a13417de79eed391fde0a004607157780ba079e510abad4a85305377c229f897108e80053594a1964435e33ceb8adf371954205d5894b256b1c
|
data/lib/trackler/version.rb
CHANGED
@@ -10,11 +10,15 @@ regarded as forming a rectangle when printed with intervening newlines.
|
|
10
10
|
|
11
11
|
For example, the sentence
|
12
12
|
|
13
|
-
|
13
|
+
```text
|
14
|
+
"If man was meant to stay on the ground, god would have given us roots."
|
15
|
+
```
|
14
16
|
|
15
17
|
is normalized to:
|
16
18
|
|
17
|
-
|
19
|
+
```text
|
20
|
+
"ifmanwasmeanttostayonthegroundgodwouldhavegivenusroots"
|
21
|
+
```
|
18
22
|
|
19
23
|
The plaintext should be organized in to a rectangle. The size of the
|
20
24
|
rectangle (`r x c`) should be decided by the length of the message,
|
@@ -25,13 +29,13 @@ Our normalized text is 54 characters long, dictating a rectangle with
|
|
25
29
|
`c = 8` and `r = 7`:
|
26
30
|
|
27
31
|
```text
|
28
|
-
ifmanwas
|
29
|
-
meanttos
|
30
|
-
tayonthe
|
31
|
-
groundgo
|
32
|
-
dwouldha
|
33
|
-
vegivenu
|
34
|
-
sroots
|
32
|
+
"ifmanwas"
|
33
|
+
"meanttos"
|
34
|
+
"tayonthe"
|
35
|
+
"groundgo"
|
36
|
+
"dwouldha"
|
37
|
+
"vegivenu"
|
38
|
+
"sroots "
|
35
39
|
```
|
36
40
|
|
37
41
|
The coded message is obtained by reading down the columns going left to
|
@@ -40,7 +44,7 @@ right.
|
|
40
44
|
The message above is coded as:
|
41
45
|
|
42
46
|
```text
|
43
|
-
imtgdvsfearwermayoogoanouuiontnnlvtwttddesaohghnsseoau
|
47
|
+
"imtgdvsfearwermayoogoanouuiontnnlvtwttddesaohghnsseoau"
|
44
48
|
```
|
45
49
|
|
46
50
|
Output the encoded text in chunks that fill perfect rectangles `(r X c)`,
|
@@ -49,19 +53,19 @@ with `c` chunks of `r` length, separated by spaces. For phrases that are
|
|
49
53
|
chunks with a single trailing space.
|
50
54
|
|
51
55
|
```text
|
52
|
-
imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau
|
56
|
+
"imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau "
|
53
57
|
```
|
54
58
|
|
55
59
|
Notice that were we to stack these, we could visually decode the
|
56
60
|
cyphertext back in to the original message:
|
57
61
|
|
58
62
|
```text
|
59
|
-
imtgdvs
|
60
|
-
fearwer
|
61
|
-
mayoogo
|
62
|
-
anouuio
|
63
|
-
ntnnlvt
|
64
|
-
wttddes
|
65
|
-
aohghn
|
66
|
-
sseoau
|
63
|
+
"imtgdvs"
|
64
|
+
"fearwer"
|
65
|
+
"mayoogo"
|
66
|
+
"anouuio"
|
67
|
+
"ntnnlvt"
|
68
|
+
"wttddes"
|
69
|
+
"aohghn "
|
70
|
+
"sseoau "
|
67
71
|
```
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"exercise":"yacht",
|
3
|
-
"version":"1.
|
3
|
+
"version":"1.1.0",
|
4
4
|
"comments":[
|
5
5
|
"The dice are represented always as a list of exactly five integers",
|
6
6
|
"with values between 1 and 6 inclusive. The category is an string.",
|
@@ -130,6 +130,15 @@
|
|
130
130
|
},
|
131
131
|
"expected":0
|
132
132
|
},
|
133
|
+
{
|
134
|
+
"description":"Four of a kind is not a full house",
|
135
|
+
"property":"score",
|
136
|
+
"input":{
|
137
|
+
"dice":[1, 4, 4, 4, 4],
|
138
|
+
"category":"full house"
|
139
|
+
},
|
140
|
+
"expected":0
|
141
|
+
},
|
133
142
|
{
|
134
143
|
"description":"Yacht is not a full house",
|
135
144
|
"property":"score",
|
@@ -43,10 +43,9 @@ Render the input of a test method.
|
|
43
43
|
The `Gigasecond` generator renders the input value as a (parenthesized) `DateTime` value:
|
44
44
|
|
45
45
|
```fsharp
|
46
|
-
override __.RenderInput (
|
46
|
+
override __.RenderInput (_, _, value) =
|
47
47
|
DateTime.Parse(string value, CultureInfo.InvariantCulture)
|
48
|
-
|>
|
49
|
-
|> parenthesize
|
48
|
+
|> DateTime.renderParenthesized
|
50
49
|
```
|
51
50
|
|
52
51
|
Note that you could use the `key` field to only customize the output for specific input fields. The `Yacht` generator does this:
|
@@ -54,7 +53,7 @@ Note that you could use the `key` field to only customize the output for specifi
|
|
54
53
|
```fsharp
|
55
54
|
override __.RenderInput (canonicalDataCase, key, value) =
|
56
55
|
match key with
|
57
|
-
| "category" ->
|
56
|
+
| "category" -> Obj.renderEnum "Category" value
|
58
57
|
| _ -> base.RenderInput (canonicalDataCase, key, value)
|
59
58
|
```
|
60
59
|
|
@@ -136,11 +135,10 @@ Render a single value (which is used to render input parameters, the expected va
|
|
136
135
|
The `ComplexNumbers` generator renders different values based on the value's type:
|
137
136
|
|
138
137
|
```fsharp
|
139
|
-
override __.
|
140
|
-
match
|
141
|
-
|
|
142
|
-
|
|
143
|
-
| _ -> base.RenderValue (canonicalDataCase, key, value)
|
138
|
+
override __.PropertiesWithIdentifier canonicalDataCase =
|
139
|
+
match canonicalDataCase.Expected.Type with
|
140
|
+
| JTokenType.Array -> ["sut"]
|
141
|
+
| _ -> base.PropertiesWithIdentifier canonicalDataCase
|
144
142
|
```
|
145
143
|
|
146
144
|
### Method: MapCanonicalDataCase
|
@@ -196,8 +194,8 @@ In some cases, you want an identifier to have an explicit type. A common use cas
|
|
196
194
|
The `Minesweeper` generator adds a `string list` type annotation for empty values:
|
197
195
|
|
198
196
|
```fsharp
|
199
|
-
override __.IdentifierTypeAnnotation (_, _, value) =
|
200
|
-
match
|
197
|
+
override __.IdentifierTypeAnnotation (_, _, value) =
|
198
|
+
match Seq.isEmpty value with
|
201
199
|
| true -> Some "string list"
|
202
200
|
| false -> None
|
203
201
|
```
|
@@ -224,9 +222,9 @@ The `RationalNumbers` generator uses the `"AssertEqualWithin"` template to allow
|
|
224
222
|
|
225
223
|
```fsharp
|
226
224
|
override __.AssertTemplate canonicalDataCase =
|
227
|
-
match canonicalDataCase.Expected with
|
228
|
-
|
|
229
|
-
| _ -> base.
|
225
|
+
match canonicalDataCase.Expected.Type with
|
226
|
+
| JTokenType.Float -> "AssertEqualWithin"
|
227
|
+
| _ -> base.AssertTemplate(canonicalDataCase)
|
230
228
|
```
|
231
229
|
|
232
230
|
### Method: TestFileFormat
|
@@ -13,85 +13,85 @@ let rollMany rolls game = List.fold (fun game pins -> roll pins game) game rolls
|
|
13
13
|
let ``Should be able to score a game with all zeros`` () =
|
14
14
|
let rolls = [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]
|
15
15
|
let game = rollMany rolls (newGame())
|
16
|
-
score game |> should equal
|
16
|
+
score game |> should equal (Some 0)
|
17
17
|
|
18
18
|
[<Fact(Skip = "Remove to run test")>]
|
19
19
|
let ``Should be able to score a game with no strikes or spares`` () =
|
20
20
|
let rolls = [3; 6; 3; 6; 3; 6; 3; 6; 3; 6; 3; 6; 3; 6; 3; 6; 3; 6; 3; 6]
|
21
21
|
let game = rollMany rolls (newGame())
|
22
|
-
score game |> should equal
|
22
|
+
score game |> should equal (Some 90)
|
23
23
|
|
24
24
|
[<Fact(Skip = "Remove to run test")>]
|
25
25
|
let ``A spare followed by zeros is worth ten points`` () =
|
26
26
|
let rolls = [6; 4; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]
|
27
27
|
let game = rollMany rolls (newGame())
|
28
|
-
score game |> should equal
|
28
|
+
score game |> should equal (Some 10)
|
29
29
|
|
30
30
|
[<Fact(Skip = "Remove to run test")>]
|
31
31
|
let ``Points scored in the roll after a spare are counted twice`` () =
|
32
32
|
let rolls = [6; 4; 3; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]
|
33
33
|
let game = rollMany rolls (newGame())
|
34
|
-
score game |> should equal
|
34
|
+
score game |> should equal (Some 16)
|
35
35
|
|
36
36
|
[<Fact(Skip = "Remove to run test")>]
|
37
37
|
let ``Consecutive spares each get a one roll bonus`` () =
|
38
38
|
let rolls = [5; 5; 3; 7; 4; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]
|
39
39
|
let game = rollMany rolls (newGame())
|
40
|
-
score game |> should equal
|
40
|
+
score game |> should equal (Some 31)
|
41
41
|
|
42
42
|
[<Fact(Skip = "Remove to run test")>]
|
43
43
|
let ``A spare in the last frame gets a one roll bonus that is counted once`` () =
|
44
44
|
let rolls = [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 7; 3; 7]
|
45
45
|
let game = rollMany rolls (newGame())
|
46
|
-
score game |> should equal
|
46
|
+
score game |> should equal (Some 17)
|
47
47
|
|
48
48
|
[<Fact(Skip = "Remove to run test")>]
|
49
49
|
let ``A strike earns ten points in a frame with a single roll`` () =
|
50
50
|
let rolls = [10; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]
|
51
51
|
let game = rollMany rolls (newGame())
|
52
|
-
score game |> should equal
|
52
|
+
score game |> should equal (Some 10)
|
53
53
|
|
54
54
|
[<Fact(Skip = "Remove to run test")>]
|
55
55
|
let ``Points scored in the two rolls after a strike are counted twice as a bonus`` () =
|
56
56
|
let rolls = [10; 5; 3; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]
|
57
57
|
let game = rollMany rolls (newGame())
|
58
|
-
score game |> should equal
|
58
|
+
score game |> should equal (Some 26)
|
59
59
|
|
60
60
|
[<Fact(Skip = "Remove to run test")>]
|
61
61
|
let ``Consecutive strikes each get the two roll bonus`` () =
|
62
62
|
let rolls = [10; 10; 10; 5; 3; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]
|
63
63
|
let game = rollMany rolls (newGame())
|
64
|
-
score game |> should equal
|
64
|
+
score game |> should equal (Some 81)
|
65
65
|
|
66
66
|
[<Fact(Skip = "Remove to run test")>]
|
67
67
|
let ``A strike in the last frame gets a two roll bonus that is counted once`` () =
|
68
68
|
let rolls = [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 10; 7; 1]
|
69
69
|
let game = rollMany rolls (newGame())
|
70
|
-
score game |> should equal
|
70
|
+
score game |> should equal (Some 18)
|
71
71
|
|
72
72
|
[<Fact(Skip = "Remove to run test")>]
|
73
73
|
let ``Rolling a spare with the two roll bonus does not get a bonus roll`` () =
|
74
74
|
let rolls = [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 10; 7; 3]
|
75
75
|
let game = rollMany rolls (newGame())
|
76
|
-
score game |> should equal
|
76
|
+
score game |> should equal (Some 20)
|
77
77
|
|
78
78
|
[<Fact(Skip = "Remove to run test")>]
|
79
79
|
let ``Strikes with the two roll bonus do not get bonus rolls`` () =
|
80
80
|
let rolls = [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 10; 10; 10]
|
81
81
|
let game = rollMany rolls (newGame())
|
82
|
-
score game |> should equal
|
82
|
+
score game |> should equal (Some 30)
|
83
83
|
|
84
84
|
[<Fact(Skip = "Remove to run test")>]
|
85
85
|
let ``A strike with the one roll bonus after a spare in the last frame does not get a bonus`` () =
|
86
86
|
let rolls = [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 7; 3; 10]
|
87
87
|
let game = rollMany rolls (newGame())
|
88
|
-
score game |> should equal
|
88
|
+
score game |> should equal (Some 20)
|
89
89
|
|
90
90
|
[<Fact(Skip = "Remove to run test")>]
|
91
91
|
let ``All strikes is a perfect game`` () =
|
92
92
|
let rolls = [10; 10; 10; 10; 10; 10; 10; 10; 10; 10; 10; 10]
|
93
93
|
let game = rollMany rolls (newGame())
|
94
|
-
score game |> should equal
|
94
|
+
score game |> should equal (Some 300)
|
95
95
|
|
96
96
|
[<Fact(Skip = "Remove to run test")>]
|
97
97
|
let ``Rolls cannot score negative points`` () =
|
@@ -132,7 +132,7 @@ let ``Two bonus rolls after a strike in the last frame cannot score more than 10
|
|
132
132
|
let ``Two bonus rolls after a strike in the last frame can score more than 10 points if one is a strike`` () =
|
133
133
|
let rolls = [0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 10; 10; 6]
|
134
134
|
let game = rollMany rolls (newGame())
|
135
|
-
score game |> should equal
|
135
|
+
score game |> should equal (Some 26)
|
136
136
|
|
137
137
|
[<Fact(Skip = "Remove to run test")>]
|
138
138
|
let ``The second bonus rolls after a strike in the last frame cannot be a strike if the first one is not a strike`` () =
|
@@ -9,47 +9,47 @@ open PerfectNumbers
|
|
9
9
|
|
10
10
|
[<Fact>]
|
11
11
|
let ``Smallest perfect number is classified correctly`` () =
|
12
|
-
classify 6 |> should equal (Some Perfect)
|
12
|
+
classify 6 |> should equal (Some Classification.Perfect)
|
13
13
|
|
14
14
|
[<Fact(Skip = "Remove to run test")>]
|
15
15
|
let ``Medium perfect number is classified correctly`` () =
|
16
|
-
classify 28 |> should equal (Some Perfect)
|
16
|
+
classify 28 |> should equal (Some Classification.Perfect)
|
17
17
|
|
18
18
|
[<Fact(Skip = "Remove to run test")>]
|
19
19
|
let ``Large perfect number is classified correctly`` () =
|
20
|
-
classify 33550336 |> should equal (Some Perfect)
|
20
|
+
classify 33550336 |> should equal (Some Classification.Perfect)
|
21
21
|
|
22
22
|
[<Fact(Skip = "Remove to run test")>]
|
23
23
|
let ``Smallest abundant number is classified correctly`` () =
|
24
|
-
classify 12 |> should equal (Some Abundant)
|
24
|
+
classify 12 |> should equal (Some Classification.Abundant)
|
25
25
|
|
26
26
|
[<Fact(Skip = "Remove to run test")>]
|
27
27
|
let ``Medium abundant number is classified correctly`` () =
|
28
|
-
classify 30 |> should equal (Some Abundant)
|
28
|
+
classify 30 |> should equal (Some Classification.Abundant)
|
29
29
|
|
30
30
|
[<Fact(Skip = "Remove to run test")>]
|
31
31
|
let ``Large abundant number is classified correctly`` () =
|
32
|
-
classify 33550335 |> should equal (Some Abundant)
|
32
|
+
classify 33550335 |> should equal (Some Classification.Abundant)
|
33
33
|
|
34
34
|
[<Fact(Skip = "Remove to run test")>]
|
35
35
|
let ``Smallest prime deficient number is classified correctly`` () =
|
36
|
-
classify 2 |> should equal (Some Deficient)
|
36
|
+
classify 2 |> should equal (Some Classification.Deficient)
|
37
37
|
|
38
38
|
[<Fact(Skip = "Remove to run test")>]
|
39
39
|
let ``Smallest non-prime deficient number is classified correctly`` () =
|
40
|
-
classify 4 |> should equal (Some Deficient)
|
40
|
+
classify 4 |> should equal (Some Classification.Deficient)
|
41
41
|
|
42
42
|
[<Fact(Skip = "Remove to run test")>]
|
43
43
|
let ``Medium deficient number is classified correctly`` () =
|
44
|
-
classify 32 |> should equal (Some Deficient)
|
44
|
+
classify 32 |> should equal (Some Classification.Deficient)
|
45
45
|
|
46
46
|
[<Fact(Skip = "Remove to run test")>]
|
47
47
|
let ``Large deficient number is classified correctly`` () =
|
48
|
-
classify 33550337 |> should equal (Some Deficient)
|
48
|
+
classify 33550337 |> should equal (Some Classification.Deficient)
|
49
49
|
|
50
50
|
[<Fact(Skip = "Remove to run test")>]
|
51
51
|
let ``Edge case (no factors other than itself) is classified correctly`` () =
|
52
|
-
classify 1 |> should equal (Some Deficient)
|
52
|
+
classify 1 |> should equal (Some Classification.Deficient)
|
53
53
|
|
54
54
|
[<Fact(Skip = "Remove to run test")>]
|
55
55
|
let ``Zero is rejected (not a natural number)`` () =
|
@@ -1,19 +1,11 @@
|
|
1
1
|
module RnaTranscription
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
let dnaToRna =
|
3
|
+
let private dnaToRna =
|
6
4
|
function
|
7
|
-
| 'G' ->
|
8
|
-
| 'C' ->
|
9
|
-
| 'T' ->
|
10
|
-
| 'A' ->
|
11
|
-
| _ ->
|
12
|
-
|
13
|
-
let toRna dna =
|
14
|
-
let helper rna nucleotide =
|
15
|
-
match rna, dnaToRna nucleotide with
|
16
|
-
| Some x, Some y -> Some (x + string y)
|
17
|
-
| _ -> None
|
5
|
+
| 'G' -> 'C'
|
6
|
+
| 'C' -> 'G'
|
7
|
+
| 'T' -> 'A'
|
8
|
+
| 'A' -> 'U'
|
9
|
+
| _ -> failwith "Unknown nucleotide"
|
18
10
|
|
19
|
-
|
11
|
+
let toRna dna = String.map dnaToRna dna
|
@@ -9,21 +9,21 @@ open RnaTranscription
|
|
9
9
|
|
10
10
|
[<Fact>]
|
11
11
|
let ``RNA complement of cytosine is guanine`` () =
|
12
|
-
toRna "C" |> should equal
|
12
|
+
toRna "C" |> should equal "G"
|
13
13
|
|
14
14
|
[<Fact(Skip = "Remove to run test")>]
|
15
15
|
let ``RNA complement of guanine is cytosine`` () =
|
16
|
-
toRna "G" |> should equal
|
16
|
+
toRna "G" |> should equal "C"
|
17
17
|
|
18
18
|
[<Fact(Skip = "Remove to run test")>]
|
19
19
|
let ``RNA complement of thymine is adenine`` () =
|
20
|
-
toRna "T" |> should equal
|
20
|
+
toRna "T" |> should equal "A"
|
21
21
|
|
22
22
|
[<Fact(Skip = "Remove to run test")>]
|
23
23
|
let ``RNA complement of adenine is uracil`` () =
|
24
|
-
toRna "A" |> should equal
|
24
|
+
toRna "A" |> should equal "U"
|
25
25
|
|
26
26
|
[<Fact(Skip = "Remove to run test")>]
|
27
27
|
let ``RNA complement`` () =
|
28
|
-
toRna "ACGTGGTCTTAA" |> should equal
|
28
|
+
toRna "ACGTGGTCTTAA" |> should equal "UGCACCAGAAUU"
|
29
29
|
|