From 4b828f878bb8d2af0a02856ba4085d599857bf6f Mon Sep 17 00:00:00 2001 From: s481904 Date: Mon, 10 Jun 2024 15:41:01 +0200 Subject: [PATCH] fix gen alg --- board.py | 1 + gen_algorithm.py | 1 + 2 files changed, 2 insertions(+) diff --git a/board.py b/board.py index 3b00180f4..ae67516fd 100644 --- a/board.py +++ b/board.py @@ -38,6 +38,7 @@ class Board: def draw_cubes(self, win): + for row in range(rows): for col in range(cols): cube_rect = pygame.Rect(row * size, col * size, size, size) diff --git a/gen_algorithm.py b/gen_algorithm.py index 0a7ac4c36..0d6f5b7f0 100644 --- a/gen_algorithm.py +++ b/gen_algorithm.py @@ -22,6 +22,7 @@ def find_routes(routes_num): return np.array(population_set) #zwracamy 20 roznych losowych tras def sum_up_for_route(route_indices): + sum = 0 for i in range(len(route_indices) - 1): current_weed = weed_positions[route_indices[i]]