Bench (#14)
Co-authored-by: Smaug123 <patrick+github@patrickstevens.co.uk> Reviewed-on: #14
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
namespace AdventOfCode2023
|
||||
|
||||
open System.IO
|
||||
open System.Reflection
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module Inputs =
|
||||
let days =
|
||||
let mutable dir = Assembly.GetEntryAssembly().Location |> FileInfo |> _.Directory
|
||||
|
||||
while not (dir.EnumerateDirectories () |> Seq.exists (fun i -> i.Name = "inputs")) do
|
||||
dir <- dir.Parent
|
||||
|
||||
if isNull dir then
|
||||
failwith "reached root of filesystem without finding inputs dir"
|
||||
|
||||
Array.init 12 (fun day -> Path.Combine (dir.FullName, "inputs", $"day%i{day + 1}.txt") |> File.ReadAllText)
|
||||
|
||||
let inline day (i : int) = days.[i - 1]
|
Reference in New Issue
Block a user