# Minimax Algorithm

```
1. If the depth is zero, or the game is over, evaluate
the current state and return its value.
2. If the current agent is a max agent, initialize this
state's value to -infinity
3. Otherwise, initialize this state's value to infinity
4. For each action that this agent is able to take:
a. Create a new state by taking the specified action
b. Recursively compute the value of the new state,
either moving to the next agent at this depth,
or decreasing the depth by one if we're the last agent
c. If the current agent is a max agent, update this state's
value to the max of its current value and the new
state's computed value
d. If the current agent is a min agent, update this state's
value to the min of its current value and the new
state's computed value
5. Return the computed value, and the action that the current
agent took that led to that value
```