Modified the a_star [dot] py for making readable (#4576)

This commit is contained in:
Milton Chandro Bhowmick 2021-07-28 16:50:21 +06:00 committed by GitHub
parent a4b7d12262
commit 40d85d5443
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,7 +44,7 @@ def search(grid, init, goal, cost, heuristic):
x = init[0] x = init[0]
y = init[1] y = init[1]
g = 0 g = 0
f = g + heuristic[init[0]][init[0]] f = g + heuristic[x][y] # cost from starting cell to destination cell
cell = [[f, g, x, y]] cell = [[f, g, x, y]]
found = False # flag that is set when search is complete found = False # flag that is set when search is complete