3 ms·
The blue squares show the nodes it checked, and with A star the entire map shouldn't be blue on an empty maze.
by squeaky-clean 4y ago
The blue squares show the nodes it checked, and with A star the entire map shouldn't be blue on an empty maze.
- eknkc 4y agoYeah _0ffh's point makes sense on the path found. But even if it finds a path that is basically one horizontal one vertical line, it should still check the immediate neighbors only.
- _0ffh 4y agoYeah right, in that case there's something wrong there! Maybe in the way it queues up the options.
- squeaky-clean 4y agoThink I found it, if you change the sort in astar.ts to just return 1 or -1 based on the comparison it behaves like A-star. untraversedTiles.sort((a, b) => { if (heuristicCost[a.row][a.col] < heuristicCost[b.row][b.col]) { return-1; } return 1; });