mirror of
https://github.com/thib8956/advent-of-code.git
synced 2026-11-27 00:46:34 +00:00
intcode: cleanup
This commit is contained in:
1 parent
06956da329
commit
a9d4619cac
3 files changed
+41
-25
No files matched your search
@@ -2,7 +2,7 @@
|
||||
from intcode import *
|
||||
|
||||
|
||||
def run_test(program, expected_mem=None, stdin=[], expected_out=None):
|
||||
def run_test(program, expected_mem=None, stdin=None, expected_out=None):
|
||||
mem = program[::]
|
||||
out = interpret_intcode(mem, stdin=stdin)
|
||||
if expected_mem is not None:
|
||||
@@ -22,6 +22,10 @@ def test_day2():
|
||||
run_test(program, expected)
|
||||
|
||||
|
||||
def test_input_output():
|
||||
run_test([3,0,4,0,99], stdin=[42], expected_out=[42])
|
||||
|
||||
|
||||
def test_day5_basic():
|
||||
# Using position mode, consider whether the input is equal to 8; output 1
|
||||
# (if it is) or 0 (if it is not).
|
||||
|
||||
Reference in new issue
Block a user