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;