Пример #1
0
 public override bool CheckExplode(int pairCount)
 {
     //To reduce a snailfish number, you must repeatedly do the first action in this list that applies to the snailfish number:
     //If any pair is nested inside four pairs, the leftmost such pair explodes.
     if (pairCount > 4)
     {
         Explode();
         return(true);
     }
     else
     {
         if (LeftNumber.CheckExplode(pairCount + 1))
         {
             return(true);
         }
         if (RightNumber.CheckExplode(pairCount + 1))
         {
             return(true);
         }
         return(false);
     }
 }