Working with the minimization function with several minimization agents consists in launching the minimization function with the same depth for all agents. After all minimizing agents have passed, you run the maximize function on the last minimizing agent.
# HOW YOU HANDLE THE MINIMIZING FUNCTION - If this pseudocode helps make better sense out of this. scores = [] if agent == end_of_minimizing_agents: # last minimizing agent for actions in legal_actions: depth_reduced = depth-1 scores.append(max(successor_state, depth_reduced)) else: for actions in legal_actions: scores.append(min(successor_state, depth)) bestScore = min(scores) return bestScore
source share