finish q8
This commit is contained in:
@ -517,8 +517,7 @@ class ClosestDotSearchAgent(SearchAgent):
|
|||||||
walls = gameState.getWalls()
|
walls = gameState.getWalls()
|
||||||
problem = AnyFoodSearchProblem(gameState)
|
problem = AnyFoodSearchProblem(gameState)
|
||||||
|
|
||||||
"*** YOUR CODE HERE ***"
|
return search.bfs(problem)
|
||||||
util.raiseNotDefined()
|
|
||||||
|
|
||||||
class AnyFoodSearchProblem(PositionSearchProblem):
|
class AnyFoodSearchProblem(PositionSearchProblem):
|
||||||
"""
|
"""
|
||||||
@ -551,10 +550,7 @@ class AnyFoodSearchProblem(PositionSearchProblem):
|
|||||||
The state is Pacman's position. Fill this in with a goal test that will
|
The state is Pacman's position. Fill this in with a goal test that will
|
||||||
complete the problem definition.
|
complete the problem definition.
|
||||||
"""
|
"""
|
||||||
x,y = state
|
return state in self.food.asList()
|
||||||
|
|
||||||
"*** YOUR CODE HERE ***"
|
|
||||||
util.raiseNotDefined()
|
|
||||||
|
|
||||||
def mazeDistance(point1: Tuple[int, int], point2: Tuple[int, int], gameState: pacman.GameState) -> int:
|
def mazeDistance(point1: Tuple[int, int], point2: Tuple[int, int], gameState: pacman.GameState) -> int:
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user