Advent of Code 2020, now in the most terse and awful python possible
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
355 B

#!/usr/bin/env python3
from sys import argv
i = [x.strip() for x in open(argv[1])]
h = len(i)
w = len(i[0])
def check(dx, dy):
x = 0
y = 0
ok = 0
while y < h:
if i[y][x%w] == "#":
ok += 1
x += dx
y += dy
return ok
print(check(3,1))
print(check(1,1)*check(3,1)*check(5,1)*check(7,1)*check(1,2))