My Advent of Code solutions in Python. kevinyap.ca/2019/12/going-fast-in-advent-of-code/
advent-of-code python
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update day13.py

+2 -2
+2 -2
2016/day13.py
··· 3 3 INPUT = int(fileinput.input()[0]) 4 4 5 5 6 - def is_open(x, y, input=INPUT): 6 + def is_open(x, y, seed=INPUT): 7 7 """Open space if number of 1 bits is even, else wall.""" 8 - num = (x * x) + (3 * x) + (2 * x * y) + y + (y * y) + input 8 + num = (x * x) + (3 * x) + (2 * x * y) + y + (y * y) + seed 9 9 return bin(num)[2:].count('1') % 2 == 0 10 10 11 11