-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
25 lines (18 loc) · 812 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import argparse
from common import get_module
parser = argparse.ArgumentParser()
parser.add_argument('-d', '--day', type=int, help='Number of day (from 1 to 25)')
parser.add_argument('-i', '--input', type=str, help='Relative path to custom input file')
parser.add_argument('-t', '--test', action='store_true', help='Use test data')
parser.add_argument('-p', '--part', type=int, help='Part to solve only')
def main(_day: int, _test: bool, _file: str, _part: int):
cls = get_module(_day)
print(
cls(_day).solve(_file, _test, _part)
)
if __name__ == "__main__":
args = parser.parse_args()
if args.day is None:
print('No day specified, run the 1st day puzzle as example...')
day = args.day if args.day is not None else 1
main(day, args.test, args.input, args.part)