Exemplo n.º 1
0
 def test_constructDay11RobotPainter(self):
     path = 'Inputs/inputDay11'
     robotPainter = constructRobotPainterFromPath(path)
     robotPainter.run()
     self.assertEqual(2064,
                      len(robotPainter.painter.map.knownCoordinatesNames))
     self.assertEqual(2064,
                      len(robotPainter.painter.map.knownCoordinatesObjects))
Exemplo n.º 2
0
day9computer = constructComputerFromFile(pathInput9)
day9computer.inputs.append(1)
with patch('builtins.print') as p:
    day9computer.run()
print(
    f'Day 9, part 1: The BOOST keycode is: {day9computer.outputs[0]} (3380552333)'
)
day9part2computer = constructComputerFromFile(pathInput9)
day9part2computer.inputs.append(2)
with patch('builtins.print') as p:
    day9part2computer.run()
print(
    f'Day 9, part 2: The coordinates for the Ceres monitoring station are: {day9part2computer.outputs[0]} (78831)'
)
pathInput11 = 'Inputs/inputDay11'
day11RobotPainter = constructRobotPainterFromPath(pathInput11)
day11RobotPainter.run()
day11NumberPainted = len(day11RobotPainter.painter.map.knownCoordinatesNames)
print(
    f'Day 11, part 1: The number of panels painted at least once is: {day11NumberPainted} (2064)'
)
day11RobotPainterPartTwo = constructRobotPainterFromPath(pathInput11)
day11RobotPainterPartTwo.painter.paintCurrentWhite()
day11RobotPainterPartTwo.run()
print('Day 11, part 2: (LPZKLGHR)')
day11RobotPainterPartTwo.painter.map.printMap(pretty=True)

inputDay13 = 'Inputs/inputDay13'
day13ArcadeCabinet = constructArcadeCabinetFromPath(inputDay13)
day13ArcadeCabinet.startGame()
day13ArcadeCabinet.populateScreen()