mirror of
https://github.com/Crocmagnon/advent-of-code.git
synced 2024-12-24 23:01:55 +01:00
Add new day script
This commit is contained in:
parent
3fe94bbb02
commit
144814eaed
2 changed files with 15 additions and 8 deletions
13
2020/new_day
Executable file
13
2020/new_day
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
set -euxo pipefail
|
||||
|
||||
if [[ $# -ne 2 ]]; then
|
||||
>&2 echo "Usage: $0 <number> <python_module_name>"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
filename=day$1_$2.py
|
||||
cp template.py $filename
|
||||
sed -e "s/dayXX/day$1/g" -i "" ./$filename
|
||||
touch inputs/day$1
|
||||
touch inputs/day$1-test1
|
|
@ -1,8 +1,3 @@
|
|||
import functools
|
||||
import re
|
||||
from typing import Dict, Iterable, List, Union
|
||||
|
||||
|
||||
def main(filename: str, expected_part_1: int = None, expected_part_2: int = None):
|
||||
print(f"\n+ Running on {filename}")
|
||||
with open(filename) as f:
|
||||
|
@ -29,6 +24,5 @@ def solve_part_2(data):
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main("inputs/day14-test1", 436)
|
||||
main("inputs/day14-test2", 1)
|
||||
main("inputs/day14")
|
||||
main("inputs/dayXX-test1")
|
||||
main("inputs/dayXX")
|
||||
|
|
Loading…
Reference in a new issue