repositories
/
advent18.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c8e32d5
)
levenstein segfault
levenstein
author
Mart Lubbers
<mart@martlubbers.net>
Sun, 2 Dec 2018 10:25:56 +0000
(11:25 +0100)
committer
Mart Lubbers
<mart@martlubbers.net>
Sun, 2 Dec 2018 10:25:56 +0000
(11:25 +0100)
2/s2.icl
patch
|
blob
|
history
diff --git
a/2/s2.icl
b/2/s2.icl
index
fe363bf
..
72d2ba6
100644
(file)
--- a/
2/s2.icl
+++ b/
2/s2.icl
@@
-3,6
+3,7
@@
module s2
import StdEnv
import Data.Func
import Data.List
+import Debug.Trace
getinput :: [Char] *File -> [[Char]]
getinput a f
@@
-20,4
+21,6
@@
Start w
$ getinput [] io
proc [] = []
-proc [x:xs] = [[(e, x)\\e<-xs | length [()\\a<-x & b<-e | a<>b] <= 1]:proc xs]
+proc [x:xs] = [[(e, x)\\e<-xs | levenshtein` x e <= 1]:proc xs]
+
+levenshtein` a b = levenshtein (trace_stdout a) (trace_stdout b)