Exemplo n.º 1
0
        public void Day3_Calculate()
        {
            var input1 = new List <string>()
            {
                "#1 @ 1,3: 4x4", "#2 @ 3,1: 4x4", "#3 @ 5,5: 2x2"
            };

            Assert.AreEqual(4, Day3.Calculate(8, 8, input1).OverlappingCount);

            var input2 = FileUtil.Get2018File("Day3.txt");

            Assert.AreEqual(110389, Day3.Calculate(1000, 1000, input2).OverlappingCount);
        }
Exemplo n.º 2
0
        public void Day3_CalculatePart2()
        {
            var input1 = new List <string>()
            {
                "#1 @ 1,3: 4x4", "#2 @ 3,1: 4x4", "#3 @ 5,5: 2x2"
            };

            Assert.AreEqual(1, Day3.Calculate(8, 8, input1).NonOverlappingClaims.Count());
            Assert.AreEqual(3, Day3.Calculate(8, 8, input1).NonOverlappingClaims.First());

            var input2 = FileUtil.Get2018File("Day3.txt");

            Assert.AreEqual(1, Day3.Calculate(1000, 1000, input2).NonOverlappingClaims.Count());
            Assert.AreEqual(552, Day3.Calculate(1000, 1000, input2).NonOverlappingClaims.First());
        }
Exemplo n.º 3
0
 public void Testing_part_1()
 {
     Day3.Calculate("day3_test1.txt").Should().Be(198);
 }
Exemplo n.º 4
0
 public void Running_part_1()
 {
     Day3.Calculate("day3.txt").Should().Be(2595824);
 }