Ejemplo n.º 1
0
        public override string SecondStar()
        {
            var input  = ReadLineInput();
            var result = PixelArt.CountPixelsOnAfterExpansion(input, 18);

            return(result.ToString());
        }
Ejemplo n.º 2
0
        public void Problem1_Example()
        {
            string[] input =
            {
                "../.# => ##./#../...",
                ".#./..#/### => #..#/..../..../#..#"
            };

            var onCountAfterExpansion = PixelArt.CountPixelsOnAfterExpansion(input, 2);

            Assert.Equal(12, onCountAfterExpansion);
        }
Ejemplo n.º 3
0
        public void Expand()
        {
            var pixelSet = new PixelSet(new Grid(".#./..#/###"));

            string[] input =
            {
                "../.# => ##./#../...",
                ".#./..#/### => #..#/..../..../#..#",
            };
            var rules   = PixelArt.ReadRules(input);
            var rotated = pixelSet.Expand(rules);

            var expected = new PixelSet(new Grid("#..#/..../..../#..#"));

            Assert.Equal(expected, rotated);
        }