From 71c2f3bb9d2899e2e4e1c0ecfc667b413501ed34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Sat, 21 Dec 2019 20:33:00 +0100 Subject: Fix returns --- 19/py/d21.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to '19/py/d21.py') diff --git a/19/py/d21.py b/19/py/d21.py index 84f01ff..03ba4fc 100644 --- a/19/py/d21.py +++ b/19/py/d21.py @@ -2,14 +2,15 @@ import intcode def ascii_draw(a): s = "" + post = "" for c in a: if c == 10: s += "\n" elif c < 128: s += chr(c) else: - print("[INVALID ASCII]", c) - return s + post = "[INVALID ASCII]: " + str(c) + return s + ("\n" if post != "" else "") + post def do(c, jumpscript): output = [] -- cgit v1.2.1