Example #1
0
        public void Part2()
        {
            VirtualGrid3 <bool> reactor = new VirtualGrid3 <bool>();

            foreach (VirtualGrid3Region <bool> step in ReadStepsFromFile())
            {
                reactor.Set(step);
            }

            long result = reactor.Where(r => r.Value).Sum(r => r.Size);

            Assert.Equal(1311612259117092, result);
        }
Example #2
0
        public void Part1()
        {
            VirtualGrid3 <bool> reactor = new VirtualGrid3 <bool>();

            foreach (VirtualGrid3Region <bool> step in ReadStepsFromFile().Where(step => IsWithinBounds(step, Point3.One * -50, Point3.One * 50)))
            {
                reactor.Set(step);
            }

            long result = reactor.Where(r => r.Value).Sum(r => r.Size);

            Assert.Equal(612714, result);
        }