diff options
author | Tomasz Chojnacki <tomaszchojnacki2001@gmail.com> | 2023-03-02 21:40:59 +0100 |
---|---|---|
committer | Tomasz Chojnacki <tomaszchojnacki2001@gmail.com> | 2023-03-02 21:40:59 +0100 |
commit | 6c661db5b3e167d45554f7c5e4838dbc3bffa63a (patch) | |
tree | 6ba5eebddc1713f5bd4ee9fe740937a8031d151e /aoc-2020-gleam/src/days/day03.gleam | |
parent | 2ba7501d516afa4ab240faccefb6a3f72223598e (diff) | |
download | gleam_aoc2020-6c661db5b3e167d45554f7c5e4838dbc3bffa63a.tar.gz gleam_aoc2020-6c661db5b3e167d45554f7c5e4838dbc3bffa63a.zip |
Refactor using constructs from Gleam v0.27
Diffstat (limited to 'aoc-2020-gleam/src/days/day03.gleam')
-rw-r--r-- | aoc-2020-gleam/src/days/day03.gleam | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/aoc-2020-gleam/src/days/day03.gleam b/aoc-2020-gleam/src/days/day03.gleam index e4cecda..4c1ef59 100644 --- a/aoc-2020-gleam/src/days/day03.gleam +++ b/aoc-2020-gleam/src/days/day03.gleam @@ -5,6 +5,7 @@ import gleam/string as str import gleam/function as fun import gleam/iterator as iter import gleam/set.{Set} +import ext/intx import ext/resultx as resx import ext/iteratorx as iterx import util/input_util @@ -62,7 +63,7 @@ fn has_tree(in area: Area, at pos: Pos) -> Bool { } fn is_valid(pos: Pos, in area: Area) -> Bool { - 0 <= pos.1 && pos.1 < area.height + intx.is_between(pos.1, 0, and: area.height - 1) } fn tree_count(in area: Area, with slope: Pos) -> Int { |