mirror of
https://github.com/thib8956/advent-of-code.git
synced 2026-11-06 10:02:27 +00:00
chore: create new project structure and aoc.py runner script
This commit is contained in:
1 parent
f76375d835
commit
e2964c6c36
91 files changed
+177
-113
No files matched your search
@@ -0,0 +1,20 @@
|
||||
# TODO replace PYTHONPATH hack with a proper solution, like making intcode an
|
||||
# installed module https://stackoverflow.com/a/50194143
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
sys.path.append(str(Path(__file__).absolute().parent.parent / "intcode"))
|
||||
|
||||
from intcode import interpret_intcode
|
||||
|
||||
|
||||
def main(inp):
|
||||
mem = list(map(int, inp.readline().rstrip().split(",")))
|
||||
print("Part 1: ", interpret_intcode(mem[::], stdin=[1]).stdout[0])
|
||||
print("Part 2: ", interpret_intcode(mem[::], stdin=[2]).stdout[0])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import fileinput
|
||||
main(fileinput.input())
|
||||
|
||||
Reference in new issue
Block a user