Esempio n. 1
0
        protected override void SolvePartOne()
        {
            var cgrid = new Grid <char>(' ', true); //Using different defaultTile so we can count all tiles that have been changed
            EmergencyHullPaintingRobot bot = new EmergencyHullPaintingRobot(program, cgrid);

            while (bot.PerformStep())
            {
            }

            resultPartOne = cgrid.CountNonDefault().ToString();
        }
Esempio n. 2
0
        protected override void SolvePartTwo()
        {
            var cgrid = new Grid <char>('.', true);

            cgrid[0, 0] = '#';
            var bot = new EmergencyHullPaintingRobot(program, cgrid);

            while (bot.PerformStep())
            {
            }
            var image     = cgrid.RowsAsStrings();
            var imgString = string.Join("\r\n", image);

            resultPartTwo = imgString;
        }