Пример #1
0
        public static string GetExpression(ExpressionInfo exressInfo)
        {
            int num1 = GetNum(exressInfo.Min, exressInfo.Max);
            Thread.Sleep(50);
            int num2 = GetNum(exressInfo.Min, exressInfo.Max);

            ExpressionOperator exOper = exressInfo.Oper;
            CorrectExpression(ref exOper, ref num1, ref num2, exressInfo.ResultMax);

            return num1.ToString() + OperatorToString(exOper) + num2.ToString();
        }
Пример #2
0
        private void UpdateMath()
        {
            ExpressionInfo expInfo = new ExpressionInfo();
            expInfo.Min = 0;
            expInfo.Max = 10;
            expInfo.ResultMax = 10;

            if (_mathCount % 2 == 0)
            {
                expInfo.Oper = ExpressionOperator.Subtract;
            }
            else
            {
                expInfo.Oper = ExpressionOperator.Add;
            }

            expressionText.Text = Expression.GetExpression(expInfo);
        }