-
Notifications
You must be signed in to change notification settings - Fork 3
/
DayT.fs
30 lines (23 loc) · 787 Bytes
/
DayT.fs
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
open System
open System.Text.RegularExpressions
let toBlocks (str: string) = Regex.Split(str.Trim(), @"(?:\r?\n){2,}")
let toLines (str: string) = Regex.Split(str.Trim(), @"\r?\n") |> Array.toList
let inline toChars (str: string) = str.ToCharArray()
let lines = System.IO.File.ReadAllLines("Day2.txt")
let parse (ln: string) =
let flds = Regex.Split(ln, @" ")
flds.[0]
let input = lines |> Array.map parse |> Array.toList
let part1 () =
input
let part2 () =
"?"
[<EntryPoint>]
// let main _ = printfn "Part 1: %A" (part1 ()); printfn "Part 2: %A" (part2 ()); 0
let main _ =
let sw = System.Diagnostics.Stopwatch ()
sw.Start()
printfn "Part 1: %A" (part1 ()); printfn "Part 2: %A" (part2 ());
sw.Stop()
printfn "%f" sw.Elapsed.TotalSeconds
0