Exemple #1
0
        private string GetPart2Solution()
        {
            PaintableHullSection hull  = new PaintableHullSection();
            PaintingRobot        robot = new PaintingRobot(hull, 1);

            return(hull.GetAreaOfInterest());
        }
Exemple #2
0
        private int GetPart1Solution()
        {
            PaintableHullSection hull  = new PaintableHullSection();
            PaintingRobot        robot = new PaintingRobot(hull, 0);

            return(robot.PaintedPanels);
        }
        public PaintingRobot(PaintableHullSection hull, int startingColour)
        {
            _program     = SharedLibrary.FileParser.GetLongIntCodeFromFile(@"Inputs\Day11Input.txt");
            _inputQueue  = new Queue <long>();
            _outputQueue = new Queue <long>();


            _hull = hull;
            RobotInputProvider inputProvider = new RobotInputProvider(_hull, this);

            _vm        = new IntcodeVirtualMachine(_program, inputProvider, new QueueOutputProvider(_outputQueue));
            _direction = Direction.North;

            SetStartingColour(startingColour);

            RunRobot();
        }
 public RobotInputProvider(PaintableHullSection hullSection, PaintingRobot paintingRobot)
 {
     _robot = paintingRobot;
     _hull  = hullSection;
 }