Using curryfication
authorGreg Burri <greg.burri@gmail.com>
Sun, 10 Dec 2017 20:52:23 +0000 (21:52 +0100)
committerGreg Burri <greg.burri@gmail.com>
Sun, 10 Dec 2017 20:52:23 +0000 (21:52 +0100)
AdventOfCode2017/Day10.fs

index 2383dee..a5cdb5d 100644 (file)
@@ -22,4 +22,4 @@ let knotHash1 (str : string) =
     knotHash 1 (fun s -> s.[0] * s.[1] |> string) (str.Split ',' |> List.ofArray |> List.map int)
 
 let knotHash2 (str : string) =
-    knotHash 64 (fun s -> s |> Array.chunkBySize 16 |> Array.map (Array.reduce (^^^) >> sprintf "%02x") |> Array.reduce (+)) (List.append (str |> List.ofSeq |> List.map int) [ 17; 31; 73; 47; 23 ]) 256
\ No newline at end of file
+    knotHash 64 (Array.chunkBySize 16 >> Array.map (Array.reduce (^^^) >> sprintf "%02x") >> Array.reduce (+)) (List.append (str |> List.ofSeq |> List.map int) [ 17; 31; 73; 47; 23 ]) 256
\ No newline at end of file