From 2b3170d10cf5ff4af58b2db271b681e8c767cd15 Mon Sep 17 00:00:00 2001 From: jakzar Date: Fri, 10 May 2024 17:47:05 +0200 Subject: [PATCH] This: -refactor few lines to disable Astar related functions and behaviour --- App.py | 2 +- Pole.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/App.py b/App.py index 090d36d..84bcc10 100644 --- a/App.py +++ b/App.py @@ -16,7 +16,7 @@ bfs1_flag=False bfs2_flag=False #Change this lines to show different bfs implementation bfs3_flag=False Astar = False -Astar2 = True +Astar2 = False if bfs3_flag or Astar or Astar2: Pole.stoneFlag = True diff --git a/Pole.py b/Pole.py index f0e5b8b..82427c8 100644 --- a/Pole.py +++ b/Pole.py @@ -53,7 +53,10 @@ class Pole: time.sleep(3) #self.ui.render_text("Randomizing Crops") for coordinates in self.slot_dict: - if(coordinates==(0,0) or coordinates in stoneList or coordinates == self.gasStation): + if(stoneFlag): + if( coordinates in stoneList or coordinates == self.gasStation ): + continue + if(coordinates==(0,0)): continue else: self.slot_dict[coordinates].set_random_plant()