Skip to content

Commit

Permalink
Edit Q1
Browse files Browse the repository at this point in the history
  • Loading branch information
ameerezae committed May 21, 2021
1 parent 9e904c5 commit 2b7e876
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions multiAgents.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,9 @@ def evaluationFunction(self, currentGameState, action):
if util.manhattanDistance(newPos, ghostState.getPosition()) <= 1:
return -1

isFood = 0
if newPos in currentGameState.getFood().asList():
isFood = 1.0
else:
isFood = 0.0
isFood = 1

newFoodList = newFood.asList()
manhattanFoodDistance = [util.manhattanDistance(newPos, foodPos) for foodPos in newFoodList]
Expand Down

0 comments on commit 2b7e876

Please sign in to comment.