diff options
| author | Gustav Sörnäs <gusso230@student.liu.se> | 2019-12-08 11:06:56 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gusso230@student.liu.se> | 2019-12-08 11:06:56 +0100 |
| commit | 29e33f8f6a31565f5a2671b1c459ff1b829630f7 (patch) | |
| tree | c051274a9e9a895049a077a6bdce9056dfb9afb1 /solutions/py/02-1.py | |
| parent | d16fc72a33fced8c8623bea6cf9cdd9cf8999024 (diff) | |
| download | aoc-29e33f8f6a31565f5a2671b1c459ff1b829630f7.tar.gz | |
Refactor and create main.py
Diffstat (limited to 'solutions/py/02-1.py')
| -rw-r--r-- | solutions/py/02-1.py | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/solutions/py/02-1.py b/solutions/py/02-1.py deleted file mode 100644 index 47ab15f..0000000 --- a/solutions/py/02-1.py +++ /dev/null @@ -1,19 +0,0 @@ -import sys - -program = [int(x) for x in input().split(",")] - -memory = program.copy() -memory[1] = 12 -memory[2] = 2 - -pointer = 0 -while True: - if memory[pointer] == 99: - break - elif memory[pointer] == 1: - memory[memory[pointer+3]] = memory[memory[pointer+1]] + memory[memory[pointer+2]] - elif memory[pointer] == 2: - memory[memory[pointer+3]] = memory[memory[pointer+1]] * memory[memory[pointer+2]] - pointer += 4 -print(memory[0]) - |
