naprawiony bfs 3
This commit is contained in:
parent
e5f4c9d466
commit
139068130b
@ -21,7 +21,7 @@ class AI:
|
|||||||
def ready(self):
|
def ready(self):
|
||||||
self.saper.set_map(self.current_map)
|
self.saper.set_map(self.current_map)
|
||||||
|
|
||||||
goal_state = [minesweeper.Map.mines[0].position_x, minesweeper.Map.mines[0].position_y]
|
goal_state = [self.current_map.mines[0].position_x, self.current_map.mines[0].position_y]
|
||||||
print(goal_state)
|
print(goal_state)
|
||||||
|
|
||||||
find_path = bfs.BFS(self.saper)
|
find_path = bfs.BFS(self.saper)
|
||||||
@ -80,8 +80,8 @@ class AI:
|
|||||||
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:
|
elif len(self.current_map.mines)!=0:
|
||||||
goal_state = [minesweeper.Map.mines[0].position_x, minesweeper.Map.mines[0].position_y]
|
goal_state = [self.current_map.mines[0].position_x, self.current_map.mines[0].position_y]
|
||||||
print(goal_state)
|
print(goal_state)
|
||||||
|
|
||||||
find_path = bfs.BFS(self.saper)
|
find_path = bfs.BFS(self.saper)
|
||||||
|
Loading…
Reference in New Issue
Block a user