title: Berkeley Pacman CornersProblem
body: <p>I've been working on Berkeley's Pacman project for their A.I. course. I'm running into an issue figuring out how to find a path so that pacman touches all four corners of the pacman board. It uses a general breadth-first search algorithm. It only returns a path when there is one goal state, and not four.</p>
  
  <p>The project for this particular question states: </p>
  
  <p>In corner mazes, there are four dots, one in each corner. Our new search problem is to find the shortest path through the maze that touches all four corners (whether the maze actually has food there or not). Note that for some mazes like tinyCorners, the shortest path does not always go to the closest food first! Hint: the shortest path through tinyCorners takes 28 steps.</p>
  
  <p>Implement the CornersProblem search problem in searchAgents.py. You will need to choose a state representation that encodes all the information necessary to detect whether all four corners have been reached.</p>
  
  <p>BFS:</p>
  
  <pre><code>fringe = util.Queue()
  fringe.push( (problem.getStartState(), [], 0) )    
  visited = set()
  
  while not fringe.isEmpty():
      curState, curAction, curCost = fringe.pop()
  
      if curState in visited:
          continue
      visited.add(curState)
  
      if problem.isGoalState(curState):
          return curAction
  
      for state, action, cost in problem.getSuccessors(curState):
          fringe.push( (state, curAction + [action], cost ) )
  
  return []
  
  util.raiseNotDefined()
  </code></pre>
  
  <p>Search Agent Start State: </p>
  
  <pre><code>def getStartState(self):
      """
      Returns the start state (in your state space, not the full Pacman state
      space)
      """
      "*** YOUR CODE HERE ***"
      return self.startingPosition
      util.raiseNotDefined()
  </code></pre>
  
  <p>SearchAgent Goal State</p>
  
  <pre><code>"""
  Returns whether this search state is a goal state of the problem.
  """
  "*** YOUR CODE HERE ***"
  
  // TODO
  util.raiseNotDefined()
  </code></pre>
  
  <p>I'm stuck on the returning the goal state so that the test passes. Currently, the function returns: </p>
  
  <pre><code>*** FAIL: test_cases/q5/corner_tiny_corner.test
  
  *** Corners missed: [(1, 1), (1, 6), (6, 1), (6, 6)]
  
  *** Tests failed.
  </code></pre>
  
  <p>Or I return only 1 out of the 4 corners. </p>