Scaffolding
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
<Compile Include="Day5.fs" />
|
||||
<Compile Include="Day6.fs" />
|
||||
<Compile Include="Day7.fs" />
|
||||
<Compile Include="Day8.fs" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
30
AdventOfCode2023.FSharp/AdventOfCode2023.FSharp.Lib/Day8.fs
Normal file
30
AdventOfCode2023.FSharp/AdventOfCode2023.FSharp.Lib/Day8.fs
Normal file
@@ -0,0 +1,30 @@
|
||||
namespace AdventOfCode2023
|
||||
|
||||
open System
|
||||
open System.Globalization
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module Day8 =
|
||||
|
||||
let parse (s : string) : ResizeArray<int> =
|
||||
use mutable lines = StringSplitEnumerator.make '\n' s
|
||||
let result = ResizeArray ()
|
||||
|
||||
while lines.MoveNext () do
|
||||
if not lines.Current.IsEmpty then
|
||||
use mutable line = StringSplitEnumerator.make' ' ' lines.Current
|
||||
line.MoveNext () |> ignore
|
||||
result.Add (3)
|
||||
|
||||
result
|
||||
|
||||
let part1 (s : string) =
|
||||
let arr = parse s
|
||||
let mutable answer = 0
|
||||
answer
|
||||
|
||||
let part2 (s : string) =
|
||||
let arr = parse s
|
||||
let mutable answer = 0
|
||||
|
||||
answer
|
Reference in New Issue
Block a user