diff options
author | J.J <thechairman@thechairman.info> | 2023-12-17 21:28:03 -0500 |
---|---|---|
committer | J.J <thechairman@thechairman.info> | 2023-12-17 21:28:03 -0500 |
commit | 83199de370f15c961502dc37cc7fc09e2be2030f (patch) | |
tree | b32d707f26d8081a4e536dbe355eb231d2b05007 /aoc2023 | |
parent | 7709cc9954456195d9894e092aa8d23e42125a16 (diff) | |
download | gleam_aoc-83199de370f15c961502dc37cc7fc09e2be2030f.tar.gz gleam_aoc-83199de370f15c961502dc37cc7fc09e2be2030f.zip |
day 17 racket complete
Diffstat (limited to 'aoc2023')
-rw-r--r-- | aoc2023/src/day17/solve.gleam | 31 | ||||
-rw-r--r-- | aoc2023/test/day17/day17_test.gleam | 19 |
2 files changed, 24 insertions, 26 deletions
diff --git a/aoc2023/src/day17/solve.gleam b/aoc2023/src/day17/solve.gleam index 3ed632c..431dcc7 100644 --- a/aoc2023/src/day17/solve.gleam +++ b/aoc2023/src/day17/solve.gleam @@ -1,36 +1,17 @@ import adglent.{First, Second} import gleam/io +import gleam/string 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" + input + |> array2d.parse_grid + |> string.inspect } pub fn part2(input: String) { - todo as "Implement solution to part 2" + input + |> string.inspect } pub fn main() { diff --git a/aoc2023/test/day17/day17_test.gleam b/aoc2023/test/day17/day17_test.gleam index cf624fb..c1ebd22 100644 --- a/aoc2023/test/day17/day17_test.gleam +++ b/aoc2023/test/day17/day17_test.gleam @@ -13,7 +13,24 @@ type Problem2AnswerType = /// ```gleam ///const part1_examples: List(Example(Problem1AnswerType)) = [Example("some input", "")] /// ``` -const part1_examples: List(Example(Problem1AnswerType)) = [] +const part1_examples: List(Example(Problem1AnswerType)) = [ + Example( + "2413432311323 +3215453535623 +3255245654254 +3446585845452 +4546657867536 +1438598798454 +4457876987766 +3637877979653 +4654967986887 +4564679986453 +1224686865563 +2546548887735 +4322674655533", + "102", + ), +] /// Add examples for part 2 here: /// ```gleam |