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

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

            return(robot.PaintedPanels);
        }
示例#3
0
        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();
        }
示例#4
0
 public RobotInputProvider(PaintableHullSection hullSection, PaintingRobot paintingRobot)
 {
     _robot = paintingRobot;
     _hull  = hullSection;
 }