From 6c661db5b3e167d45554f7c5e4838dbc3bffa63a Mon Sep 17 00:00:00 2001 From: Tomasz Chojnacki Date: Thu, 2 Mar 2023 21:40:59 +0100 Subject: Refactor using constructs from Gleam v0.27 --- aoc-2020-gleam/src/days/day03.gleam | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'aoc-2020-gleam/src/days/day03.gleam') 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 { -- cgit v1.2.3