A* search algorithm: Difference between revisions

Content added Content deleted
m (→‎{{header|Wren}}: Changed to Wren S/H)
 
Line 103: Line 103:
f[neighbour] = G[neighbour] + H
f[neighbour] = G[neighbour] + H


X RuntimeError(‘A* failed to find a solution’)
X.throw RuntimeError(‘A* failed to find a solution’)


V (result, cost) = AStarSearch((0, 0), (7, 7), [[(2, 4), (2, 5), (2, 6), (3, 6), (4, 6), (5, 6), (5, 5), (5, 4), (5, 3), (5, 2), (4, 2), (3, 2)]])
V (result, cost) = AStarSearch((0, 0), (7, 7), [[(2, 4), (2, 5), (2, 6), (3, 6), (4, 6), (5, 6), (5, 5), (5, 4), (5, 3), (5, 2), (4, 2), (3, 2)]])