Was adding wrong edge

This commit is contained in:
2022-01-17 16:31:28 -05:00
parent 05d5cf3d79
commit 2ab8740228

View File

@@ -39,7 +39,7 @@ void prim(mazegrid_t const* g, mazegrid_t* result) {
} }
if ((e.x < g->width - 1) && !node_set_contains(s, e.x + 1, e.y)) { if ((e.x < g->width - 1) && !node_set_contains(s, e.x + 1, e.y)) {
_point_t pt = { e.x + 1, e.y, EDGE_LEFT }; _point_t pt = { e.x + 1, e.y, EDGE_LEFT };
PUSH_PQ(q, PointPQ, pt, mazegrid_get_edge(g, e.x, e.y, EDGE_LEFT)); PUSH_PQ(q, PointPQ, pt, mazegrid_get_edge(g, e.x, e.y, EDGE_RIGHT));
} }
if ((e.y > 0) && !node_set_contains(s, e.x, e.y - 1)) { if ((e.y > 0) && !node_set_contains(s, e.x, e.y - 1)) {
_point_t pt = { e.x, e.y - 1, EDGE_UP }; _point_t pt = { e.x, e.y - 1, EDGE_UP };