From e5f4c9d466bedad5b1011a1e9606cd36e1f5ad46 Mon Sep 17 00:00:00 2001 From: s464859 <@> Date: Thu, 7 Apr 2022 16:47:58 +0200 Subject: [PATCH] naprawiony bfs 2 --- classes/ai.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/classes/ai.py b/classes/ai.py index 7c1cae5..b8f3d8d 100644 --- a/classes/ai.py +++ b/classes/ai.py @@ -79,4 +79,10 @@ class AI: if len(self.the_way)>0: way = self.the_way.pop(0) self.saper.rotate(way) - self.saper.move() \ No newline at end of file + self.saper.move() + else: + goal_state = [minesweeper.Map.mines[0].position_x, minesweeper.Map.mines[0].position_y] + print(goal_state) + + find_path = bfs.BFS(self.saper) + self.the_way = find_path.graphsearch([], [], bfs.BFS.successor, goal_state) \ No newline at end of file