diff options
author | HJ <thechairman@thechairman.info> | 2023-12-17 20:35:20 -0500 |
---|---|---|
committer | HJ <thechairman@thechairman.info> | 2023-12-17 20:35:20 -0500 |
commit | 7709cc9954456195d9894e092aa8d23e42125a16 (patch) | |
tree | dbe8ef13b9bfd8fbbae2f98c94ab474c5598efb4 /aoc2023/src/day17/solve.gleam | |
parent | 96c8dd61ba3804ea97927342bf7660985afed9eb (diff) | |
parent | 9f0d9e4de0e6a69b9770b227f669af75667b8c90 (diff) | |
download | gleam_aoc-7709cc9954456195d9894e092aa8d23e42125a16.tar.gz gleam_aoc-7709cc9954456195d9894e092aa8d23e42125a16.zip |
Merge branch 'main' of https://github.com/hunkyjimpjorps/AdventOfCode
Diffstat (limited to 'aoc2023/src/day17/solve.gleam')
-rw-r--r-- | aoc2023/src/day17/solve.gleam | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/aoc2023/src/day17/solve.gleam b/aoc2023/src/day17/solve.gleam index 5289ce9..3ed632c 100644 --- a/aoc2023/src/day17/solve.gleam +++ b/aoc2023/src/day17/solve.gleam @@ -1,5 +1,29 @@ import adglent.{First, Second} import gleam/io +import utilities/array2d.{type Posn, Posn} + +type Direction { + North + South + East + West +} + +fn turn_dirs(dir: Direction) { + case dir { + North | South -> [East, West] + East | West -> [North, South] + } +} + +fn delta(dir: Direction) { + case dir { + North -> Posn(-1, 0) + South -> Posn(1, 0) + East -> Posn(0, 1) + West -> Posn(0, -1) + } +} pub fn part1(input: String) { todo as "Implement solution to part 1" |