base minimax functionality