You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AdventOfCode19/days/day5.py

22 lines
643 B

import unittest
import os
from .comp import OpcodeComputer
class Day5(unittest.TestCase):
def get_code(self):
inputfile = os.path.join(os.path.dirname(__file__), "input/day5_input")
with open(inputfile) as fp:
return [int(k) for k in fp.readline().split(',')]
def test_day5a(self):
sut = OpcodeComputer(self.get_code())
outp = list(sut.process_op([1]))
self.assertEqual(int(outp[-1]), 8332629)
def test_day5b(self):
sut = OpcodeComputer(self.get_code())
outp = list(sut.process_op([5]))
self.assertEqual(int(outp[0]), 8805067)