naprawiony bfs 2
This commit is contained in:
parent
bec25a4e4a
commit
e5f4c9d466
@ -79,4 +79,10 @@ class AI:
|
|||||||
if len(self.the_way)>0:
|
if len(self.the_way)>0:
|
||||||
way = self.the_way.pop(0)
|
way = self.the_way.pop(0)
|
||||||
self.saper.rotate(way)
|
self.saper.rotate(way)
|
||||||
self.saper.move()
|
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)
|
Loading…
Reference in New Issue
Block a user