Was adding wrong edge
This commit is contained in:
@@ -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 };
|
||||||
|
|||||||
Reference in New Issue
Block a user