forked from exercism/futhark
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.fut
More file actions
49 lines (39 loc) · 812 Bytes
/
test.fut
File metadata and controls
49 lines (39 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import "hamming"
-- empty strands
-- ==
-- input { "" "" }
-- output { 0 }
-- single letter identical strands
-- ==
-- input { "A" "A" }
-- output { 0 }
-- single letter different strands
-- ==
-- input { "G" "T" }
-- output { 1 }
-- long identical strands
-- ==
-- input { "GGACTGAAATCTG" "GGACTGAAATCTG" }
-- output { 0 }
-- long different strands
-- ==
-- input { "GGACGGATTCTG" "AGGACGGATTCT" }
-- output { 9 }
-- disallow first strand longer
-- ==
-- input { "AATG" "AAA" }
-- error: Error*
-- disallow second strand longer
-- ==
-- input { "ATA" "AGTG" }
-- error: Error*
-- disallow empty first strand
-- ==
-- input { "" "G" }
-- error: Error*
-- disallow empty second strand
-- ==
-- input { "G" "" }
-- error: Error*
let main (strand1: []u8) (strand2: []u8): i32 =
distance strand1 strand2