Exemple #1
0
        public string Part1(string[] input)
        {
            var painter = new RobotPainter(input[0]);

            painter.Run();

            return(painter.Grid.Count.ToString());
        }
Exemple #2
0
        public string Part2(string[] input)
        {
            var painter = new RobotPainter(input[0]);

            painter.Grid[new Point(0, 0)] = 1;
            painter.Run();
            var grid = painter.Grid;

            var gridHeight = grid.Max(kvp => kvp.Key.Y) + grid.Min(kvp => kvp.Key.Y);
            var gridWidth  = grid.Max(kvp => kvp.Key.X) + grid.Min(kvp => kvp.Key.X);

            return(PrintGrid(gridHeight, gridWidth, grid));
        }