def _find_paths_to_closest_ghosts(self, pac_loc):
ghosts = [self.state.red_ghost, self.state.pink_ghost, self.state.orange_ghost, self.state.blue_ghost]
state_paths = [(ghost.state, bfs(self.grid, pac_loc, (ghost.x, ghost.y), GHOST_CUTOFF)) for ghost in ghosts]
return [sp for sp in state_paths if sp[1] is not None]
评论列表
文章目录