Exemplo n.º 1
0
 public TestStats(string Name, string Difficulty, Equation currentEquation, int TotalQuestions = 10)
 {
     this.Name = Name;
     this.Difficulty = Difficulty;
     this.TotalQuestions = TotalQuestions;
     this.CurrentEquation = currentEquation;
 }
Exemplo n.º 2
0
        public Equation CreateEquation()
        {
            Equation eq = new Equation();
            IOperator theOp = GetRandomOperator();
            eq.Operation = theOp.Name;

            //get the set of numbers that followed the rules of the operator
            SetsOfNumbersLoader ss = new SetsOfNumbersLoader(theOp.OperationRules);
            var setOfNumbers = ss.GetSetOfNumbers();

            //pick random set and set that into the equation
            var randCombo = setOfNumbers[r.Next(0, setOfNumbers.Count())];
            eq.FirstNum = randCombo.X;
            eq.SecondNum = randCombo.Y;
            eq.Answer = theOp.TheOperation(eq.FirstNum, eq.SecondNum);

            return eq;
        }