Exemplo n.º 1
0
 public void Add(int newFactor)
 {
     InAList.Add(newFactor);
     if (InAList.Count > 0 && InAList.Last() > newFactor)
     {
         throw new Exception("Your list is out of order!");
     }
     if (newFactor == lastFactor || newFactor == 2)
     {
         consecutiveFactorCounter++;
     }
     else
     {
         consecutiveFactorCounter = 0;
     }
     lastFactor = newFactor;
 }
Exemplo n.º 2
0
 public void Add(int newFactor)
 {
     InAList.Add(newFactor);
     if (InAList.Count > 0 && InAList.Last() > newFactor)
     {
         throw new Exception("Your list is out of order!");
     }
     if (newFactor == lastFactor || newFactor == 2)
     {
         consecutiveFactorCounter++;
     }
     else
     {
         AsExponents.Add(new Value((double)lastFactor, (double)consecutiveFactorCounter, NumberType.exponent, Restrictions.dontFactorDontSetFraction));
         consecutiveFactorCounter = 0;
     }
     lastFactor = newFactor;
 }