formatting and cosmetic updates to 2020.
This commit is contained in:
parent
84c4cf9991
commit
cd75e58f77
28 changed files with 320 additions and 287 deletions
28
2020/template/temp.py
Executable file
28
2020/template/temp.py
Executable file
|
|
@ -0,0 +1,28 @@
|
|||
#! /usr/bin/env python3
|
||||
|
||||
import pathlib
|
||||
import sys
|
||||
|
||||
def parse(puzzle_input: str):
|
||||
"""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()
|
||||
solutions = solve(puzzle_input)
|
||||
print("\n".join(str(solution) for solution in solutions))
|
||||
Loading…
Add table
Add a link
Reference in a new issue