예제 #1
0
 /// <summary>
 /// Randomly generates a question
 /// </summary>
 public MathQuestion(DifficultyLevel level)
 {
     if (Rand == null)
     {
         Rand = new Random(Environment.TickCount);
     }
     Interpreter = MakeRandomInterpreter(level);
 }
예제 #2
0
 /// <summary>
 /// Manually create math question
 /// </summary>
 /// <param name="op">Operator to use</param>
 public MathQuestion(MathInterpreter interpreter)
 {
     if (Rand == null)
     {
         Rand = new Random(Environment.TickCount);
     }
     Interpreter = interpreter;
 }
예제 #3
0
        public static List <MathObject> CloneMathObjects(MathInterpreter interpreter)
        {
            List <MathObject> list = new List <MathObject>();

            foreach (MathObject item in interpreter)
            {
                list.Add(item);
            }
            return(list);
        }