A* search algorithm: Difference between revisions
Content added Content deleted
Line 1,004: | Line 1,004: | ||
path2graphic(x, path) = (x in obstacles ? '█' : x in path ? 'x' : '.') |
path2graphic(x, path) = (x in obstacles ? '█' : x in path ? 'x' : '.') |
||
for |
for row in 8:-1:1, col in 7:-1:0 |
||
print(path2graphic( |
print(path2graphic(row*8 - col, path)) |
||
if |
if col == 0 |
||
println() |
println() |
||
end |
end |
||
⚫ | |||
end |
|||
⚫ | |||
Solution has cost 11: |
Solution has cost 11: |
||
Tuple{Int64,Int64}[(0, 0), (1, 1), (2, 2), (3, 1), (4, 1), (5, 1), (6, 2), (7, 3), (7, 4), (6, 5), (6, 6), (7, 7)] |
Tuple{Int64,Int64}[(0, 0), (1, 1), (2, 2), (3, 1), (4, 1), (5, 1), (6, 2), (7, 3), (7, 4), (6, 5), (6, 6), (7, 7)] |
||
...xx..x |
|||
..x..xx. |
|||
.x█████. |
|||
.█████x. |
|||
. |
.x█...█. |
||
. |
.x█...█. |
||
. |
..x.███. |
||
...... |
.x...... |
||
....... |
x....... |
||
</pre> |
</pre> |
||