Преглед на файлове

Changes to helpers

master
Noëlle Anthony преди 11 месеца
родител
ревизия
d72e143bc1
променени са 6 файла, в които са добавени 33 реда и са изтрити 13 реда
  1. 8
    2
      day01-1.py
  2. 5
    7
      day01-2.py
  3. 5
    1
      day02-1.py
  4. 5
    1
      day02-2.py
  5. 5
    1
      day03-1.py
  6. 5
    1
      day03-2.py

+ 8
- 2
day01-1.py Целия файл

@@ -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.

+ 5
- 7
day01-2.py Целия файл

@@ -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.

+ 5
- 1
day02-1.py Целия файл

@@ -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)]

+ 5
- 1
day02-2.py Целия файл

@@ -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)]

+ 5
- 1
day03-1.py Целия файл

@@ -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:

+ 5
- 1
day03-2.py Целия файл

@@ -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:

Loading…
Отказ
Запис