From f2910faba99b6031e81e9ba83fd423a05f5a250a Mon Sep 17 00:00:00 2001 From: mid-kid Date: Fri, 9 Dec 2022 17:35:34 +0100 Subject: [PATCH] cleanup --- d09.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/d09.cc b/d09.cc index b38b724..481f042 100644 --- a/d09.cc +++ b/d09.cc @@ -88,8 +88,8 @@ void output_img(const vector &knot, const unordered_set &visited) TAIL, HEAD }; - unsigned width = max_x - min_x; - unsigned height = max_y - min_y; + unsigned width = max_x + 1 - min_x; + unsigned height = max_y + 1 - min_y; auto map = vector(width * height); for (auto i : visited) map[(i.y - min_y) * width + (i.x - min_x)] = VISITED;