diff options
author | Tomasz Chojnacki <tomaszchojnacki2001@gmail.com> | 2022-12-13 16:38:41 +0100 |
---|---|---|
committer | Tomasz Chojnacki <tomaszchojnacki2001@gmail.com> | 2022-12-13 16:38:41 +0100 |
commit | 6fc820cd0cb61a4bacda5f5b40c98dda850d75da (patch) | |
tree | 7d08b0adbf8c1b60be906cab3ee7b76767b6908e /aoc-2022-dotnet/Day09/Program.fs | |
parent | eb7cdaab9b9c13b3594e0abdbbff6f72f8cb4807 (diff) | |
download | gleam_aoc2020-6fc820cd0cb61a4bacda5f5b40c98dda850d75da.tar.gz gleam_aoc2020-6fc820cd0cb61a4bacda5f5b40c98dda850d75da.zip |
Upload days 12 and 13
Diffstat (limited to 'aoc-2022-dotnet/Day09/Program.fs')
-rw-r--r-- | aoc-2022-dotnet/Day09/Program.fs | 13 |
1 files changed, 6 insertions, 7 deletions
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])) |