From 7ba3e185247d29560b210848b977cf399f0d9fb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Mon, 23 Dec 2019 08:11:19 +0100 Subject: Day 23 --- 19/py/intcode.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to '19/py/intcode.py') 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() -- cgit v1.2.1