From 7a5f1983f9189422ad5e12afde11d11bec30a3f1 Mon Sep 17 00:00:00 2001 From: Tomasz Chojnacki Date: Fri, 22 Dec 2023 18:31:14 +0100 Subject: Solve part 1 of day 20 --- aoc-2020-gleam/src/util/pos2.gleam | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'aoc-2020-gleam/src/util/pos2.gleam') diff --git a/aoc-2020-gleam/src/util/pos2.gleam b/aoc-2020-gleam/src/util/pos2.gleam index 0b6256c..3f478ac 100644 --- a/aoc-2020-gleam/src/util/pos2.gleam +++ b/aoc-2020-gleam/src/util/pos2.gleam @@ -8,6 +8,14 @@ pub type Pos2 = pub const zero = #(0, 0) +pub fn x(pos: Pos2) -> Int { + pos.0 +} + +pub fn y(pos: Pos2) -> Int { + pos.1 +} + pub fn directions8() -> Set(Pos2) { set.from_list({ use x <- list.flat_map(over: [-1, 0, 1]) -- cgit v1.2.3