Esempio n. 1
0
        public static void DimensionMultiply <THypercube>(THypercube rangeLower, THypercube rangeUpper, Action <THypercube> action, THypercube current, int currentDimension)
            where THypercube : HypercubeBase
        {
            for (int i = rangeLower[currentDimension]; i <= rangeUpper[currentDimension]; i++)
            {
                current[currentDimension] = i;

                if (currentDimension == 0)
                {
                    action(current);
                }
                else
                {
                    Day17.DimensionMultiply(rangeLower, rangeUpper, action, current, currentDimension - 1);
                }
            }
        }
Esempio n. 2
0
 public override long Part2()
 {
     return(Day17.EvaluateCycles <Hypercube4D>(6, this.GetInputRaw()));
 }
Esempio n. 3
0
 public static void DimensionMultiply <THypercube>(THypercube rangeLower, THypercube rangeUpper, Action <THypercube> action)
     where THypercube : HypercubeBase, new()
 {
     Day17.DimensionMultiply(rangeLower, rangeUpper, action, new THypercube(), rangeLower.Dimensions - 1);
 }