From 6fc820cd0cb61a4bacda5f5b40c98dda850d75da Mon Sep 17 00:00:00 2001 From: Tomasz Chojnacki Date: Tue, 13 Dec 2022 16:38:41 +0100 Subject: Upload days 12 and 13 --- aoc-2022-dotnet/Day09/Program.fs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'aoc-2022-dotnet/Day09/Program.fs') diff --git a/aoc-2022-dotnet/Day09/Program.fs b/aoc-2022-dotnet/Day09/Program.fs index df9f040..83df6fd 100644 --- a/aoc-2022-dotnet/Day09/Program.fs +++ b/aoc-2022-dotnet/Day09/Program.fs @@ -4,13 +4,12 @@ open System.IO open Common let directionToVec = - Vec2 - << function - | 'U' -> (0, 1) - | 'R' -> (1, 0) - | 'D' -> (0, -1) - | 'L' -> (-1, 0) - | char -> failwithf "Invalid direction: %c" char + function + | 'U' -> Vec2.up + | 'R' -> Vec2.right + | 'D' -> Vec2.down + | 'L' -> Vec2.left + | char -> failwithf "Invalid direction: %c" char let parseHeadMoves = Seq.collect (fun (line: string) -> Seq.replicate (int line[2..]) (directionToVec line[0])) -- cgit v1.2.3