mirror of
https://github.com/Smaug123/AdventOfCode2021
synced 2025-10-05 15:58:40 +00:00
Fantomas format
This commit is contained in:
@@ -7,6 +7,6 @@ module Program =
|
||||
| "1" ->
|
||||
printfn $"{Day1.part1 ()}"
|
||||
printfn $"{Day1.part2 ()}"
|
||||
| s ->
|
||||
failwithf $"Unexpected argument: %s{s}"
|
||||
| s -> failwithf $"Unexpected argument: %s{s}"
|
||||
|
||||
0
|
||||
|
@@ -7,11 +7,7 @@ open FsUnitTyped
|
||||
module TestDay1 =
|
||||
|
||||
[<Fact>]
|
||||
let ``Part 1`` () =
|
||||
Day1.part1 ()
|
||||
|> shouldEqual 1766
|
||||
let ``Part 1`` () = Day1.part1 () |> shouldEqual 1766
|
||||
|
||||
[<Fact>]
|
||||
let ``Part 2`` () =
|
||||
Day1.part2 ()
|
||||
|> shouldEqual 1797
|
||||
let ``Part 2`` () = Day1.part2 () |> shouldEqual 1797
|
||||
|
13
Utils.fs
13
Utils.fs
@@ -5,15 +5,20 @@ open System.Reflection
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module Utils =
|
||||
type private Dummy = class end
|
||||
type private Dummy =
|
||||
class
|
||||
end
|
||||
|
||||
let readResource' (name : string) : string array =
|
||||
let asm = Assembly.GetAssembly typeof<Dummy>
|
||||
use stream = asm.GetManifestResourceStream (sprintf "AdventOfCode2021.Inputs.%s" name)
|
||||
|
||||
use stream =
|
||||
asm.GetManifestResourceStream (sprintf "AdventOfCode2021.Inputs.%s" name)
|
||||
|
||||
let s =
|
||||
use reader = new StreamReader (stream)
|
||||
reader.ReadToEnd ()
|
||||
|
||||
s.Split ('\r', '\n')
|
||||
|
||||
let inline readResource (name : string) : string list =
|
||||
readResource' name |> List.ofArray
|
||||
let inline readResource (name : string) : string list = readResource' name |> List.ofArray
|
||||
|
Reference in New Issue
Block a user