Skip to content

Commit

Permalink
bug: more bugfixing at day 16 part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Flashky committed Dec 16, 2024
1 parent 7bf62d6 commit 1db7e68
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ private Set<Tile> findPathIntersections() {
current = current.getParent();
} while(current != start);

start.setPath(true);

return intersections;
}

Expand All @@ -230,14 +232,15 @@ private void reset() {
}

private void fillPath(Tile start, Tile end) {

Tile current = end;
while(current != start) {
current = current.getParent();
current.setPath(true);
}

start.setPath(true);
end.setPath(true); // just in case

}

Expand Down

0 comments on commit 1db7e68

Please sign in to comment.