import math
def minimax(node: any, depth: int, maximizing_player: bool):
"""
`node`: ???
`depth`: Used to limit search depth
`color`: Determines perspective of current player. In a two-player game, would be `1` if Player A, `-1` if Player B
"""
if depth == 0 or node.is_terminal():
return node.heuristic_value()
if maximizing_player:
value = -math.inf
for child in node.children():
value = max(value, minimax(child, depth - 1, False))
else:
value = math.inf
for child in node.children():
value = min(value, minimax(child, depth - 1, True))
return value