From 19fcc2539440ae73cc6bab1e77ecf502e2f1ea7f Mon Sep 17 00:00:00 2001 From: Marta Roszak Date: Mon, 27 Apr 2020 12:50:09 +0200 Subject: [PATCH] route_planning-mam nadzieje ze sie nie rozjezdza teraz --- Raporty/route-planning.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Raporty/route-planning.md b/Raporty/route-planning.md index 0cbb2e8..4d61cda 100644 --- a/Raporty/route-planning.md +++ b/Raporty/route-planning.md @@ -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)