| @@ -1,8 +1,14 @@ | |||
| from helpers import Helper | |||
| helper = Helper(debug=True) | |||
| debug = helper.debug | |||
| load_input = helper.load_input | |||
| def main(): | |||
| from string import digits | |||
| with open("day01.input", "r") as file: | |||
| input_lines = file.readlines() | |||
| input_lines = load_input(1) | |||
| # The calibration value of each line is the first and last digit | |||
| # in each line, in order, combined to make a two-digit number. | |||
| @@ -1,17 +1,15 @@ | |||
| DEBUG = False | |||
| DEBUG_PREFIX = "" | |||
| from helpers import Helper | |||
| def debug(message, *args, **kwargs): | |||
| if DEBUG: | |||
| print(f"{DEBUG_PREFIX} {message}", *args, **kwargs) | |||
| helper = Helper(debug=True) | |||
| debug = helper.debug | |||
| load_input = helper.load_input | |||
| def main(): | |||
| from string import digits | |||
| DIGITS_SPELLED = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"] | |||
| with open("day01.input", "r") as file: | |||
| input_lines = file.readlines() | |||
| input_lines = load_input(1) | |||
| # The calibration value of each line is the first and last digit | |||
| # in each line, in order, combined to make a two-digit number. | |||
| @@ -1,6 +1,10 @@ | |||
| import re | |||
| from helpers import DEBUG, debug, load_input | |||
| from helpers import Helper | |||
| helper = Helper(debug=True) | |||
| debug = helper.debug | |||
| load_input = helper.load_input | |||
| def split_line(line, character): | |||
| return [group.strip() for group in line.split(character)] | |||
| @@ -1,6 +1,10 @@ | |||
| import re | |||
| from helpers import DEBUG, debug, load_input | |||
| from helpers import Helper | |||
| helper = Helper(debug=True) | |||
| debug = helper.debug | |||
| load_input = helper.load_input | |||
| def split_line(line, character): | |||
| return [group.strip() for group in line.split(character)] | |||
| @@ -1,4 +1,8 @@ | |||
| from helpers import debug, load_input | |||
| from helpers import Helper | |||
| helper = Helper(debug=True) | |||
| debug = helper.debug | |||
| load_input = helper.load_input | |||
| def is_digit(n): | |||
| try: | |||
| @@ -1,4 +1,8 @@ | |||
| from helpers import debug, load_input | |||
| from helpers import Helper | |||
| helper = Helper(debug=True) | |||
| debug = helper.debug | |||
| load_input = helper.load_input | |||
| def is_digit(n): | |||
| try: | |||