31 lines
674 B
Python
Executable file
31 lines
674 B
Python
Executable file
#! /usr/bin/env python3
|
|
|
|
import pathlib
|
|
import sys
|
|
# import parse
|
|
|
|
def parse(puzzle_input):
|
|
"""Parse input"""
|
|
|
|
def part1(data):
|
|
"""Solve part 1"""
|
|
|
|
def part2(data):
|
|
"""Solve part 2"""
|
|
|
|
def solve(puzzle_input):
|
|
"""Solve the puzzle for the given input"""
|
|
data = parse(puzzle_input)
|
|
solution1 = part1(data)
|
|
solution2 = part2(data)
|
|
|
|
return solution1, solution2
|
|
|
|
if __name__ == "__main__":
|
|
for path in sys.argv[1:]:
|
|
print(f"{path}:")
|
|
puzzle_input = pathlib.Path(path).read_text().strip()
|
|
print(f'{puzzle_input}')
|
|
solutions = solve(puzzle_input)
|
|
print("\n".join(str(solution) for solution in solutions))
|