Page MenuHomePhabricator

Pathfinding TNT
Updated 803 Days AgoPublic

Suggested variation on Dijkstra's. From starting position, add all empty nodes to queue to be checked. While that queue isn't empty, pop first node, check to see if it's out of blast radius. If it is, done. If not, add all nearby nodes, not in queue, and not in checked nodes to queue, put the node in checked nodes. When adding a node to the queue, also keep track of the node that you are coming from. Then can follow back to starting position and would have the path to take.

Node: x, y coordinate in tuple*

Checked Nodes: List of nodes already checked.

Unchecked Nodes: Queue, tuple of two nodes, maybe?

*assuming each block has an x, y coordinate.

Last Author
Last Edited
Jun 2 2020, 3:38 PM