From 538309d6905dd610bdd2d8febdcbb1d3cf7990fe Mon Sep 17 00:00:00 2001 From: kageru Date: Thu, 22 Dec 2022 20:38:34 +0100 Subject: [PATCH] =?UTF-8?q?don=E2=80=99t=20reverse=20grid=20when=20printin?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2022/src/grid.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2022/src/grid.rs b/2022/src/grid.rs index f454b38..39eff06 100644 --- a/2022/src/grid.rs +++ b/2022/src/grid.rs @@ -128,8 +128,8 @@ pub fn get_boundaries(input: &[&PositionND<2>]) -> Boundaries { pub fn draw_ascii(coordinates: &HashMap, T>) -> String { let b = get_boundaries(&coordinates.keys().collect::>()); join( - (b.y_min..=b.y_max).rev().map(|y| { - (b.x_min..=b.x_max).map(|x| coordinates.get(&PositionND([x, y])).unwrap_or(&T::default()).to_string()).collect::() + (b.x_min..=b.x_max).map(|x| { + (b.y_min..=b.y_max).map(|y| coordinates.get(&PositionND([x, y])).unwrap_or(&T::default()).to_string()).collect::() }), "\n", )