@@ -0,0 +1,816 @@
+import re%0Afrom numpy import matrix%0A%0A%0Ainstructions = %5B%5D%0A%0Awith open('input.txt', 'r') as f:%0A    regex = re.compile(r'(%5B%5Cw %5D+) (%5Cd+),(%5Cd+) .+ (%5Cd+),(%5Cd+)')%0A    for line in f:%0A        match = regex.match(line)%0A        instructions.append((%0A            match.group(1),%0A            (int(match.group(2)), int(match.group(3))),%0A            (int(match.group(3)), int(match.group(5)))%0A        ))%0A%0Alights = matrix(%5B%5B0 for i in range(1000)%5D for j in range(1000)%5D)%0A%0Adef act(instruction):%0A    action = instruction%5B0%5D%0A    x1, y1 = instruction%5B1%5D%0A    x2, y2 = instruction%5B2%5D%0A%0A    if action == 'turn on':%0A        lights%5Bx1:x2, y1:y2%5D = 1%0A    elif action == 'turn off':%0A        lights%5Bx1:x2, y1:y2%5D = 0%0A    else:%0A        lights%5Bx1:x2, y1:y2%5D %5E= 1%0A%0Afor step in instructions:%0A    act(step)%0A%0Aprint(lights.flatten().tolist()%5B0%5D.count(1))%0A

Add currently-incorrect day 6 part 1