From 8204825a977c351f830ddb22b1dab021e19f8721 Mon Sep 17 00:00:00 2001 From: s481904 Date: Mon, 10 Jun 2024 15:47:10 +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 ae67516fd..94879b8bc 100644 --- a/board.py +++ b/board.py @@ -10,6 +10,7 @@ class Board: self.load_costs() + def load_images(self): self.grass = pygame.image.load("board/grass.png") self.dirt = pygame.image.load("board/dirt.png") diff --git a/gen_algorithm.py b/gen_algorithm.py index 0d6f5b7f0..d5378eeee 100644 --- a/gen_algorithm.py +++ b/gen_algorithm.py @@ -13,6 +13,7 @@ weed_count = len(weed_positions) def manhattan(a, b): return abs(a[0] - b[0]) + abs(a[1] - b[1]) + def find_routes(routes_num): population_set = [] # zapisujemy trasy - losowe ułóżenia for i in range(routes_num):