A* is one of those algorithms that's 20 lines of pseudocode in any textbook and then takes a long afternoon to render nicely. Two design decisions sit between "works" and "looks good": the priority queue's tie-break order (without it the explored area is asymmetric for symmetric maps) and 8-connected corner-cut blocking (without it the path slides diagonally through wall corners). This is the 500-line browser visualization that gets both right, with 23 unit tests pinning the boundaries.
🌐 Demo : https://sen.ltd/portfolio/a-star-viz/
📦 GitHub : https://github.com/sen-ltd/a-star-viz
Rewrite A* to expose its state
A textbook A* runs an internal while loop and returns once. To animate it, you need to be able to advance one node at a time and re-render the state after each step.…