Exemple #1
0
        private ExpressionSearch InitSearch()
        {
            char             d      = (char)(this.digit + '0');
            ExpressionSearch search = new ExpressionSearch()
            {
                NumeralCount = this.digit
            };

            search.AddOperator("+");
            search.AddOperator("-");
            search.AddOperator("*");
            search.AddOperator("/");
            search.AddOperator("^");
            search.AddOperator("!");
            search.AddOperator("R");
            for (int i = this.digit; i > 0; --i)
            {
                string op = new string(d, i);
                search.AddOperand(op);
            }

            search.AddOperand("." + d);
            search.AddOperand("." + d + "_");
            return(search);
        }
Exemple #2
0
 public Algorithm(params string[] args)
 {
     this.digit  = GetDigit(args);
     this.min    = GetMin(args);
     this.max    = GetMax(args);
     this.search = this.InitSearch();
 }