예제 #1
0
 public Counter(int basenum, int numOfDigits = 1)
 {
     _number = new List <Digit>();
     _base   = basenum;
     for (int i = 0; i < numOfDigits; i++)
     {
         Digit newdigit0 = new Digit(_base);
         _number.Add(newdigit0);
     }
 }
예제 #2
0
 public void Increment(int i = 0)
 {
     if (_number[i].Increment())
     {
         if (_number[i] == _number.Last())
         {
             Digit newdigit = new Digit(_base);
             _number.Add(newdigit);
         }
         Increment(i + 1);
     }
 }