more cleaning
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
|
||||
with open(r'advent_of_code\2022\day_1\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2022\1\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
# print(input)
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
with open(r'advent_of_code\2022\day_1\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2022\1\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
# print(input)
|
||||
@@ -1,4 +1,4 @@
|
||||
with open(r'advent_of_code\2022\day_2\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2022\2\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
# print(input)
|
||||
@@ -1,4 +1,4 @@
|
||||
with open(r'advent_of_code\2022\day_2\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2022\2\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
# print(input)
|
||||
@@ -1,4 +1,4 @@
|
||||
with open(r'advent_of_code\2022\day_3\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2022\3\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
test_input = '''vJrwpWtwJgWrhcsFMMfFFhFp
|
||||
@@ -1,4 +1,4 @@
|
||||
with open(r'D:\repos\advent_of_code\2022\day_3\input.txt', 'r') as file:
|
||||
with open(r'D:\repos\advent_of_code\2022\3\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
test_input = '''vJrwpWtwJgWrhcsFMMfFFhFp
|
||||
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
|
||||
with open(r'd:\repos\advent_of_code\2022\day_4\input.txt', 'r') as file:
|
||||
with open(r'd:\repos\advent_of_code\2022\4\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
# print(input)
|
||||
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
|
||||
with open(r'd:\repos\advent_of_code\2022\day_4\input.txt', 'r') as file:
|
||||
with open(r'd:\repos\advent_of_code\2022\4\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
# print(input)
|
||||
@@ -1,6 +1,6 @@
|
||||
with open(r'advent_of_code\2022\day_5\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2022\5\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
with open(r'advent_of_code\2022\day_5\test_input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2022\5\test_input.txt', 'r') as file:
|
||||
test_input = file.read()
|
||||
|
||||
# print(input)
|
||||
@@ -0,0 +1,6 @@
|
||||
import os
|
||||
|
||||
with open(r'advent_of_code\2022\5\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
print(input)
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
def main():
|
||||
print("Advent of Code - Day 5")
|
||||
file_task_1 = open(r'advent_of_code\2022\day_5\test_input.txt', 'r')
|
||||
file_task_2 = open(r'advent_of_code\2022\day_5\input.txt', 'r')
|
||||
file_task_1 = open(r'advent_of_code\2022\5\test_input.txt', 'r')
|
||||
file_task_2 = open(r'advent_of_code\2022\5\input.txt', 'r')
|
||||
task_1(file_task_1)
|
||||
#task_2(file_task_2)
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
import os
|
||||
|
||||
with open(r'advent_of_code\2022\day_5\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
print(input)
|
||||
@@ -1,6 +1,6 @@
|
||||
import re
|
||||
|
||||
with open('advent_of_code_2023\day_1\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\1\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
def grab_first_and_last_digit(line: str) -> (int):
|
||||
@@ -1,6 +1,6 @@
|
||||
import re
|
||||
|
||||
with open('advent_of_code_2023\day_1\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\1\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
def text_to_num(line: str) -> str:
|
||||
@@ -1,7 +1,7 @@
|
||||
import numpy as np
|
||||
from queue import Queue
|
||||
|
||||
with open(r'advent_of_code\2023\day_10\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\10\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
simple_test_input = '''.....
|
||||
@@ -1,7 +1,7 @@
|
||||
import numpy as np
|
||||
from queue import Queue
|
||||
|
||||
with open(r'advent_of_code\2023\day_10\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\10\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
simple_test_input = '''.....
|
||||
@@ -1,7 +1,7 @@
|
||||
from queue import Queue
|
||||
# import os
|
||||
|
||||
with open(r'advent_of_code\2023\day_11\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\11\input.txt', 'r') as file:
|
||||
input = file.readlines()
|
||||
|
||||
# print(input)
|
||||
@@ -1,7 +1,7 @@
|
||||
from queue import Queue
|
||||
# import os
|
||||
|
||||
with open(r'advent_of_code\2023\day_11\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\11\input.txt', 'r') as file:
|
||||
input = file.readlines()
|
||||
|
||||
# print(input)
|
||||
@@ -1,4 +1,4 @@
|
||||
with open(r'advent_of_code\2023\day_12\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\12\input.txt', 'r') as file:
|
||||
input = file.readlines()
|
||||
|
||||
test_input = '''???.### 1,1,3
|
||||
@@ -1,4 +1,4 @@
|
||||
with open(r'advent_of_code\2023\day_12\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\12\input.txt', 'r') as file:
|
||||
input = file.readlines()
|
||||
|
||||
test_input = '''???.### 1,1,3
|
||||
@@ -1,7 +1,7 @@
|
||||
with open(r'advent_of_code\2023\day_13\test_input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\13\test_input.txt', 'r') as file:
|
||||
test_input = file.read()
|
||||
|
||||
with open(r'advent_of_code\2023\day_13\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\13\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
#input = test_input
|
||||
@@ -1,7 +1,7 @@
|
||||
with open(r'advent_of_code\2023\day_13\test_input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\13\test_input.txt', 'r') as file:
|
||||
test_input = file.read()
|
||||
|
||||
with open(r'advent_of_code\2023\day_13\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\13\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
#input = test_input
|
||||
@@ -1,4 +1,4 @@
|
||||
with open(r'advent_of_code\2023\day_14\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\14\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
test_input = '''O....#....
|
||||
@@ -1,4 +1,4 @@
|
||||
with open(r'advent_of_code\2023\day_14\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\14\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
test_input = '''O....#....
|
||||
@@ -1,4 +1,4 @@
|
||||
with open(r'advent_of_code\2023\day_15\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\15\input.txt', 'r') as file:
|
||||
input_data = file.read()
|
||||
|
||||
test_input = 'rn=1,cm-,qp=3,cm=2,qp-,pc=4,ot=9,ab=5,pc-,pc=6,ot=7'
|
||||
@@ -1,4 +1,4 @@
|
||||
with open(r'advent_of_code\2023\day_15\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\15\input.txt', 'r') as file:
|
||||
input_data = file.read()
|
||||
|
||||
test_input = 'rn=1,cm-,qp=3,cm=2,qp-,pc=4,ot=9,ab=5,pc-,pc=6,ot=7'
|
||||
@@ -1,5 +1,5 @@
|
||||
# Open and read the file
|
||||
with open(r'advent_of_code\2023\day_16\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\16\input.txt', 'r') as file:
|
||||
input_data = file.read()
|
||||
|
||||
test_input = r'''.|...\....
|
||||
@@ -1,5 +1,5 @@
|
||||
# Open and read the file
|
||||
with open(r'advent_of_code\2023\day_16\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\16\input.txt', 'r') as file:
|
||||
input_data = file.read()
|
||||
|
||||
test_input = r'''.|...\....
|
||||
@@ -1,6 +1,6 @@
|
||||
import heapq
|
||||
|
||||
with open(r'advent_of_code\2023\day_17\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\17\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
test_input = '''2413432311323
|
||||
@@ -1,6 +1,6 @@
|
||||
import heapq
|
||||
|
||||
with open(r'advent_of_code\2023\day_17\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\17\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
test_input = '''2413432311323
|
||||
@@ -1,4 +1,4 @@
|
||||
with open(r'advent_of_code\2023\day_2\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\2\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
# print(input)
|
||||
@@ -1,7 +1,7 @@
|
||||
from functools import reduce
|
||||
import operator
|
||||
|
||||
with open(r'advent_of_code\2023\day_2\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\2\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
# print(input)
|
||||
@@ -1,4 +1,4 @@
|
||||
# with open(r'advent_of_code\2023\day_3\input.txt', 'r') as file:
|
||||
# with open(r'advent_of_code\2023\3\input.txt', 'r') as file:
|
||||
# input = file.readlines()
|
||||
|
||||
# print(input)
|
||||
@@ -1,4 +1,4 @@
|
||||
with open(r'advent_of_code\2023\day_3\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\3\input.txt', 'r') as file:
|
||||
input = file.readlines()
|
||||
|
||||
# print(input)
|
||||
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
|
||||
with open(r'advent_of_code\2023\day_4\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\4\input.txt', 'r') as file:
|
||||
input = file.readlines()
|
||||
|
||||
# print(input)
|
||||
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
|
||||
with open(r'advent_of_code\2023\day_4\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\4\input.txt', 'r') as file:
|
||||
input = file.readlines()
|
||||
|
||||
# print(input)
|
||||
@@ -1,9 +1,9 @@
|
||||
from collections import defaultdict
|
||||
|
||||
with open(r'advent_of_code\2023\day_5\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\5\input.txt', 'r') as file:
|
||||
input = file.readlines()
|
||||
|
||||
with open(r'advent_of_code\2023\day_5\test_input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\5\test_input.txt', 'r') as file:
|
||||
test_input = file.readlines()
|
||||
|
||||
#input = test_input
|
||||
@@ -1,7 +1,7 @@
|
||||
with open(r'advent_of_code\2023\day_5\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\5\input.txt', 'r') as file:
|
||||
input = file.readlines()
|
||||
|
||||
with open(r'advent_of_code\2023\day_5\test_input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\5\test_input.txt', 'r') as file:
|
||||
test_input = file.readlines()
|
||||
|
||||
# input = test_input
|
||||
@@ -1,6 +1,6 @@
|
||||
with open(r'advent_of_code\2023\day_6\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\6\input.txt', 'r') as file:
|
||||
input = file.readlines()
|
||||
with open(r'advent_of_code\2023\day_6\test_input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\6\test_input.txt', 'r') as file:
|
||||
test_input = file.readlines()
|
||||
|
||||
#input = test_input
|
||||
@@ -1,6 +1,6 @@
|
||||
with open(r'advent_of_code\2023\day_6\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\6\input.txt', 'r') as file:
|
||||
input = file.readlines()
|
||||
with open(r'advent_of_code\2023\day_6\test_input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\6\test_input.txt', 'r') as file:
|
||||
test_input = file.readlines()
|
||||
|
||||
#input = test_input
|
||||
@@ -1,4 +1,4 @@
|
||||
with open(r'advent_of_code\2023\day_7\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\7\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
#print(input)
|
||||
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
|
||||
with open(r'advent_of_code\2023\day_7\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\7\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
#print(input)
|
||||
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
|
||||
with open(r'advent_of_code\2023\day_8\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\8\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
#print(input)
|
||||
@@ -1,6 +1,6 @@
|
||||
import math
|
||||
|
||||
with open(r'advent_of_code\2023\day_8\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\8\input.txt', 'r') as file:
|
||||
input = file.read()
|
||||
|
||||
#print(input)
|
||||
@@ -1,4 +1,4 @@
|
||||
with open(r'advent_of_code\2023\day_9\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\9\input.txt', 'r') as file:
|
||||
input = file.readlines()
|
||||
|
||||
# print(input)
|
||||
@@ -1,4 +1,4 @@
|
||||
with open(r'advent_of_code\2023\day_9\input.txt', 'r') as file:
|
||||
with open(r'advent_of_code\2023\9\input.txt', 'r') as file:
|
||||
input = file.readlines()
|
||||
|
||||
# print(input)
|
||||
Reference in New Issue
Block a user