Clean up day04 part 1
This commit is contained in:
parent
8856fe38f8
commit
142c4dd69b
1
day04.in
1
day04.in
|
@ -600,4 +600,3 @@
|
||||||
53 79 89 32 14
|
53 79 89 32 14
|
||||||
55 63 50 7 62
|
55 63 50 7 62
|
||||||
|
|
||||||
EOF
|
|
||||||
|
|
18
day04.py
18
day04.py
|
@ -42,18 +42,10 @@ def ingest(input):
|
||||||
|
|
||||||
|
|
||||||
def part1():
|
def part1():
|
||||||
with open("day04.in", "r") as f:
|
input_seq = []
|
||||||
input_seq = [int(x) for x in f.readline().rstrip().split(",")]
|
|
||||||
f.readline()
|
|
||||||
boards = []
|
boards = []
|
||||||
line = f.readline()
|
with open("day04.in", "r") as f:
|
||||||
while line != "EOF\n":
|
input_seq, boards = ingest([line for line in f])
|
||||||
board = []
|
|
||||||
while line != "\n":
|
|
||||||
board.append([int(x) for x in line.rstrip().split()])
|
|
||||||
line = f.readline()
|
|
||||||
boards.append(board)
|
|
||||||
line = f.readline()
|
|
||||||
|
|
||||||
checked = [[[0 for i in row] for row in board] for board in boards]
|
checked = [[[0 for i in row] for row in board] for board in boards]
|
||||||
score = 0
|
score = 0
|
||||||
|
@ -71,8 +63,8 @@ def part1():
|
||||||
|
|
||||||
|
|
||||||
def part2():
|
def part2():
|
||||||
input_seq = None
|
input_seq = []
|
||||||
boards = None
|
boards = []
|
||||||
with open("day04.in2", "r") as f:
|
with open("day04.in2", "r") as f:
|
||||||
input_seq, boards = ingest([line for line in f])
|
input_seq, boards = ingest([line for line in f])
|
||||||
print(input_seq)
|
print(input_seq)
|
||||||
|
|
Loading…
Reference in New Issue