3 ms·
Think 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) =>
by squeaky-clean 4y ago
Think 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;
});