route_planning-mam nadzieje ze sie nie rozjezdza teraz
This commit is contained in:
parent
5524f02464
commit
19fcc25394
@ -48,7 +48,8 @@ Jeśli nie osiągnęliśmy celu, przechodzimy do analizowania sąsiadów obecnej
|
|||||||
```python
|
```python
|
||||||
for new_position in [(0, -1), (0, 1), (-1, 0), (1, 0)]:
|
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])
|
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:
|
if node_position in cantwalk:
|
||||||
continue
|
continue
|
||||||
new_node = Node(current_node, node_position)
|
new_node = Node(current_node, node_position)
|
||||||
|
Loading…
Reference in New Issue
Block a user