diff options
| author | Gustav Sörnäs <gusso230@student.liu.se> | 2019-12-23 08:11:19 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gusso230@student.liu.se> | 2019-12-23 08:12:38 +0100 |
| commit | 7ba3e185247d29560b210848b977cf399f0d9fb7 (patch) | |
| tree | bc8dc2e16897c1b6fa8b2eb93910829e9c81d4cc /19/py/intcode.py | |
| parent | ea7a5095ea9765ecc4799fdaf7e95e49dfdc8101 (diff) | |
| download | aoc-7ba3e185247d29560b210848b977cf399f0d9fb7.tar.gz | |
Day 23
Diffstat (limited to '19/py/intcode.py')
| -rw-r--r-- | 19/py/intcode.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/19/py/intcode.py b/19/py/intcode.py index 843688c..1c0f062 100644 --- a/19/py/intcode.py +++ b/19/py/intcode.py @@ -13,14 +13,17 @@ BAS = 9 HAL = 99 class Computer(object): - def __init__(self, program, ascii=False): + def __init__(self, program, ascii=False, network_id=None): self.program = program self.memory_size = len(self.program) self.instruction_cache = {} - if ascii: - self.SIG_ASCII = True - else: - self.SIG_ASCII = False + + self.SIG_ASCII = ascii + + self.SIG_NET = False + if network_id is not None: + self.SIG_NET = True + self.network_id = network_id self.reset() |
