Solve() public méthode

Solves the specified expression.
Throws in case of any error. Throws if the specified argument is null.
public Solve ( string expression ) : string
expression string The expression.
Résultat string
Exemple #1
0
        public void HandleCalc(IRCMessage sIRCMessage)
        {
            var sSendMessage = sIrcBase.Networks[sIRCMessage.ServerName].sSendMessage;

            if(sIRCMessage.Info.Length < 5)
            {
                sSendMessage.SendChatMessage(sIRCMessage, sLManager.GetWarningText("NoValue", sIRCMessage.Channel, sIRCMessage.ServerName));
                return;
            }

            var client = new WAClient(WolframAlphaConfig.Key);
            var solution = client.Solve(sIRCMessage.Info.SplitToString(4, SchumixBase.Space));
            sSendMessage.SendChatMessage(sIRCMessage, "{0}", solution);
        }
Exemple #2
0
        public static void HandleWACommand(AlarisMainParameter mp, params string[] parameters)
        {
            var expression = parameters.ConcatenateWithSpaces();
            expression = expression.Replace("=", " = "); // for equations

            var client = new WAClient("557QYQ-UUUWTKX95V");
            /*var result = client.GetResult(expression);

            var results = from pod in result.Pods
                          where pod.Title.ToLower().Contains("solution")
                                || pod.Title.ToLower().Contains("result")
                                || pod.Title.ToLower().Contains("derivative")
                          select pod;

            foreach (var rs in results.Select(pod => pod.SubPods[0].PlainText))
            {
                mp.Bot.SendMsg(mp.Channel, rs);
            }*/

            var result = client.Solve(expression);

            mp.Bot.SendMsg(mp.Channel, result);
        }