|
@ -88,8 +88,8 @@ void output_img(const vector<Pos2d> &knot, const unordered_set<Pos2d> &visited) |
|
|
TAIL, |
|
|
TAIL, |
|
|
HEAD |
|
|
HEAD |
|
|
}; |
|
|
}; |
|
|
unsigned width = max_x - min_x; |
|
|
unsigned width = max_x + 1 - min_x; |
|
|
unsigned height = max_y - min_y; |
|
|
unsigned height = max_y + 1 - min_y; |
|
|
auto map = vector<enum Grid>(width * height); |
|
|
auto map = vector<enum Grid>(width * height); |
|
|
|
|
|
|
|
|
for (auto i : visited) map[(i.y - min_y) * width + (i.x - min_x)] = VISITED; |
|
|
for (auto i : visited) map[(i.y - min_y) * width + (i.x - min_x)] = VISITED; |
|
|