route_planning-mam nadzieje ze sie nie rozjezdza teraz

This commit is contained in:
Marta Roszak 2020-04-27 12:50:09 +02:00
parent 5524f02464
commit 19fcc25394

View File

@ -48,7 +48,8 @@ Jeśli nie osiągnęliśmy celu, przechodzimy do analizowania sąsiadów obecnej
```python
for new_position in [(0, -1), (0, 1), (-1, 0), (1, 0)]:
node_position = (current_node.position[0] + new_position[0],current_node.position[1] + new_position[1])
if node_position[0] >= (rows - 1) or node_position[0] <= 0 or node_position[1] >= (rows - 1) or node_position[1] <= 0: continue
if node_position[0] >= (rows - 1) or node_position[0] <= 0 or node_position[1] >= (rows - 1) or node_position[1] <= 0:
continue
if node_position in cantwalk:
continue
new_node = Node(current_node, node_position)