r/programming • u/hazadess • Apr 23 '13
PathFinding algorithm, visually explained
http://qiao.github.io/PathFinding.js/visual/
2.2k
Upvotes
r/programming • u/hazadess • Apr 23 '13
View all comments
Show parent comment
4
u/TinynDP Apr 24 '13
Huh. I assumed it pre-processed the map, created a list of equivilant squares, and treated anything that steps into any point in the squares as stepping into all points of the square equally.
It looks like its more about having two different recursive paths. One for the obvious steps, and one for the non-obvious steps. The visualization only treats the non-obvious steps as worth drawing, even though the code had to at very least gloss over the obvious steps along the way.