summaryrefslogtreecommitdiffstats
path: root/prog/aoc/23/13/1.py
blob: 14f231e8bbacf97cc53399541b16fa7a4e70aed1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/python3
from sys import stdin
data = stdin.read()[:-1]
patterns = []
for datum in data.split("\n\n"):
	patterns.append(datum.split("\n"))
def try_gap(pattern, gap):
	for l in range(gap+1):
		if pattern[gap-l] != pattern[line+l+1]:
			return False
	return True
def transpose(pattern):
	r = []
	for column in range(len(pattern[0])):
		l = ""
		for line in range(len(pattern)):
			l += pattern[line][column]
		r.append(l)
	return r
for pattern in patterns:
	for line in len(pattern):
		try_line(line