31 lines
724 B
Python
31 lines
724 B
Python
from asembunny import Computer, parse_assembunny_code
|
|
from tools.aoc import AOCDay
|
|
from typing import Any
|
|
|
|
|
|
class Day(AOCDay):
|
|
inputs = [
|
|
[
|
|
(3, "input23_test"),
|
|
(11004, "input23"),
|
|
],
|
|
[
|
|
(479007564, "input23"),
|
|
],
|
|
]
|
|
|
|
def part1(self) -> Any:
|
|
computer = Computer(parse_assembunny_code(self.getInput()), reg_a=7 if not self.is_test() else 0)
|
|
computer.run()
|
|
return computer.reg["a"]
|
|
|
|
def part2(self) -> Any:
|
|
computer = Computer(parse_assembunny_code(self.getInput()), reg_a=12)
|
|
computer.run()
|
|
return computer.reg["a"]
|
|
|
|
|
|
if __name__ == "__main__":
|
|
day = Day(2016, 23)
|
|
day.run(verbose=True)
|