예제 #1
0
        public void Part1()
        {
            foreach (AnchorPointWithHits anchor in AnchorsWithHits)
            {
                anchor.CalculateVisible();
            }

            int max = AnchorsWithHits.Max(a => a.NVisible);

            Console.WriteLine("Part1: {0}", max);
        }
예제 #2
0
        public void Part2()
        {
            foreach (AnchorPointWithHits anchor in AnchorsWithHits)
            {
                anchor.CalculateVisible();
            }

            int max = AnchorsWithHits.Max(a => a.NVisible);
            AnchorPointWithHits best = AnchorsWithHits.FirstOrDefault(a => a.NVisible == max);
            Angle nth = best.BlowEmUp(200);

            int rslt = nth.Target.X * 100 + nth.Target.Y;

            Console.WriteLine("Part1: {0}", rslt);
        }