title: issue with implementation of minimax algorithm for multi-agent pacman with multple min layers
body: <p>The following is the code snippet of minimax algorithm for multi-agent pacman where there are multiple ghosts(min players).</p>
  
  <pre><code>def min_max(self, gamestate, current_depth, min_count):
      if current_depth == 1:
           return (self.evaluationFunction(gamestate),None)
  # if max node
      if min_count == 0:
          min_count = gamestate.getNumAgents() - 1
          legal_actions = gamestate.getLegalActions(0)
          max_list = []
          for action in legal_actions:
              max_list.append((self.min_max(gamestate.generateSuccessor(0, action), current_depth - 1, min_count), action))
          return max(max_list, key = itemgetter(0))
  # if min nodes...
      else:
          legal_actions = gamestate.getLegalActions(min_count)
          min_list = []
          for action in legal_actions:
              min_list.append((self.min_max(gamestate.generateSuccessor(min_count, action),current_depth - 1, min_count - 1), action))
              print(current_depth,min_count)
          return min(min_list, key = itemgetter(0))
  
  pacman_move = self.min_max(gameState, self.depth * (no_of_ghosts + 1) + 1, 0)[1]
  </code></pre>
  
  <p>But I'm getting the following error: 
  ValueError: min() arg is an empty sequence.</p>
  
  <p>Any help is appreciated</p>