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.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/exercises/crypto-square/description.md +23 -19
  4. data/problem-specifications/exercises/yacht/canonical-data.json +10 -1
  5. data/tracks/clojure/exercises/gigasecond/src/gigasecond.clj +5 -0
  6. data/tracks/clojure/exercises/grade-school/src/grade_school.clj +13 -0
  7. data/tracks/clojure/exercises/grains/src/grains.clj +9 -0
  8. data/tracks/clojure/exercises/minesweeper/src/minesweeper.clj +5 -0
  9. data/tracks/fsharp/docs/GENERATORS.md +12 -14
  10. data/tracks/fsharp/exercises/bowling/BowlingTest.fs +15 -15
  11. data/tracks/fsharp/exercises/perfect-numbers/PerfectNumbersTest.fs +11 -11
  12. data/tracks/fsharp/exercises/rna-transcription/Example.fs +7 -15
  13. data/tracks/fsharp/exercises/rna-transcription/RnaTranscription.fs +1 -1
  14. data/tracks/fsharp/exercises/rna-transcription/RnaTranscriptionTest.fs +5 -5
  15. data/tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs +34 -34
  16. data/tracks/fsharp/exercises/sublist/Example.fs +1 -1
  17. data/tracks/fsharp/exercises/sublist/Sublist.fs +1 -1
  18. data/tracks/fsharp/exercises/sublist/SublistTest.fs +17 -17
  19. data/tracks/fsharp/exercises/word-search/WordSearchTest.fs +56 -57
  20. data/tracks/fsharp/generators/CanonicalData.fs +14 -15
  21. data/tracks/fsharp/generators/Common.fs +4 -84
  22. data/tracks/fsharp/generators/Conversion.fs +75 -0
  23. data/tracks/fsharp/generators/Exercise.fs +15 -11
  24. data/tracks/fsharp/generators/Generators.fs +294 -468
  25. data/tracks/fsharp/generators/Generators.fsproj +2 -1
  26. data/tracks/fsharp/generators/Rendering.fs +169 -61
  27. data/tracks/fsharp/generators/Templates.fs +64 -0
  28. data/tracks/fsharp/generators/Track.fs +3 -3
  29. data/tracks/idris/exercises/accumulate/src/Example.idr +1 -1
  30. data/tracks/idris/exercises/accumulate/src/Test/Accumulate.idr +2 -2
  31. data/tracks/java/exercises/rna-transcription/.meta/hints.md +2 -0
  32. data/tracks/java/exercises/rna-transcription/README.md +6 -0
  33. data/tracks/nim/.gitignore +1 -0
  34. data/tracks/nim/config.json +38 -0
  35. data/tracks/nim/config/maintainers.json +10 -0
  36. data/tracks/nim/docs/ABOUT.md +7 -0
  37. data/tracks/nim/exercises/bob/README.md +2 -0
  38. data/tracks/nim/exercises/bob/bob_test.nim +31 -13
  39. data/tracks/nim/exercises/bob/example.nim +2 -2
  40. data/tracks/nim/exercises/gigasecond/README.md +22 -0
  41. data/tracks/nim/exercises/gigasecond/example.nim +4 -0
  42. data/tracks/nim/exercises/gigasecond/gigasecond_test.nim +32 -0
  43. data/tracks/nim/exercises/isogram/README.md +20 -0
  44. data/tracks/nim/exercises/isogram/example.nim +6 -0
  45. data/tracks/nim/exercises/isogram/isogram_test.nim +32 -0
  46. data/tracks/nim/exercises/space-age/README.md +24 -0
  47. data/tracks/nim/exercises/space-age/example.nim +17 -0
  48. data/tracks/nim/exercises/space-age/space_age_test.nim +29 -0
  49. data/tracks/nim/exercises/triangle/example.nim +22 -22
  50. data/tracks/nim/exercises/triangle/triangle_test.nim +32 -44
  51. metadata +19 -3
  52. data/tracks/fsharp/generators/Formatting.fs +0 -189
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 904ea15d99f928d3a60c4a94f9f6f487b5c56bb4
4
- data.tar.gz: 5e14581709b274c20adacd33233c8e268534c83e
3
+ metadata.gz: b48b5f9ad4c3dda8082d4ec68ca569b6f58bcd9e
4
+ data.tar.gz: 906a0b93107cfb896d1683e08fd1de2bfb139d4a
5
5
  SHA512:
6
- metadata.gz: e02921838fab6c43ad19a3eabbf7d832e1e6f6568065420af7fa31484393f601d6e990af8eacf8093e5e3caf7885c07aa2436d2eb417977bcebc68f7cac0f2de
7
- data.tar.gz: cb188e5c1cea7a4e79f2e8bc6af2561c7b4113cbeef75feab4921d475cb5d3315a20929ade4f705a9c6a51bb1974ec6959a365065e1f7aefd6ae780c4a9f4533
6
+ metadata.gz: 061ee013f6f779604520690a10c22a0b1009322a215cef3f0143753bfe18820fa0f4023c608835db4c587ea4839a2836eb314cf6ca04be928587861e3af1b1e4
7
+ data.tar.gz: b35bb468ad872a13417de79eed391fde0a004607157780ba079e510abad4a85305377c229f897108e80053594a1964435e33ceb8adf371954205d5894b256b1c
@@ -1,3 +1,3 @@
1
1
  module Trackler
2
- VERSION = "2.2.1.138"
2
+ VERSION = "2.2.1.139"
3
3
  end
@@ -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
- > If man was meant to stay on the ground, god would have given us roots.
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
- > ifmanwasmeanttostayonthegroundgodwouldhavegivenusroots
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.0.0",
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",
@@ -0,0 +1,5 @@
1
+ (ns gigasecond)
2
+
3
+ (defn from [] ;; <- arglist goes here
4
+ ;; your code goes here
5
+ )
@@ -0,0 +1,13 @@
1
+ (ns grade-school)
2
+
3
+ (defn grade [] ;; <- arglist goes here
4
+ ;; your code goes here
5
+ )
6
+
7
+ (defn add [] ;; <- arglist goes here
8
+ ;; your code goes here
9
+ )
10
+
11
+ (defn sorted [] ;; <- arglist goes here
12
+ ;; your code goes here
13
+ )
@@ -0,0 +1,9 @@
1
+ (ns grains)
2
+
3
+ (defn square [] ;; <- arglist goes here
4
+ ;; your code goes here
5
+ )
6
+
7
+ (defn total [] ;; <- arglist goes here
8
+ ;; your code goes here
9
+ )
@@ -0,0 +1,5 @@
1
+ (ns minesweeper)
2
+
3
+ (defn draw [] ;; <- arglist goes here
4
+ ;; your code goes here
5
+ )
@@ -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 (canonicalDataCase, key, value) =
46
+ override __.RenderInput (_, _, value) =
47
47
  DateTime.Parse(string value, CultureInfo.InvariantCulture)
48
- |> formatDateTime
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" -> sprintf "Category.%s" (string value |> String.dehumanize)
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 __.RenderValue (canonicalDataCase, key, value) =
140
- match value with
141
- | :? JArray as jArray -> renderComplexNumber jArray
142
- | :? int64 as i -> sprintf "%d.0" i
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 value :?> JArray |> Seq.isEmpty with
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
- | :? double -> "AssertEqualWithin"
229
- | _ -> base.TestMethodBodyAssertTemplate(canonicalDataCase)
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 <| Some 0
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 <| Some 90
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 <| Some 10
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 <| Some 16
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 <| Some 31
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 <| Some 17
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 <| Some 10
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 <| Some 26
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 <| Some 81
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 <| Some 18
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 <| Some 20
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 <| Some 30
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 <| Some 20
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 <| Some 300
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 <| Some 26
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
- open System.Text.RegularExpressions
4
-
5
- let dnaToRna =
3
+ let private dnaToRna =
6
4
  function
7
- | 'G' -> Some 'C'
8
- | 'C' -> Some 'G'
9
- | 'T' -> Some 'A'
10
- | 'A' -> Some 'U'
11
- | _ -> None
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
- Seq.fold helper (Some "") dna
11
+ let toRna dna = String.map dnaToRna dna
@@ -1,3 +1,3 @@
1
1
  module RnaTranscription
2
2
 
3
- let toRna (dna: string): string option = failwith "You need to implement this function."
3
+ let toRna (dna: string): string = failwith "You need to implement this function."
@@ -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 (Some "G")
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 (Some "C")
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 (Some "A")
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 (Some "U")
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 (Some "UGCACCAGAAUU")
28
+ toRna "ACGTGGTCTTAA" |> should equal "UGCACCAGAAUU"
29
29