Compare commits
2 Commits
0dee47b9cc
...
a5fd026ed6
| Author | SHA1 | Date | |
|---|---|---|---|
| a5fd026ed6 | |||
| 4f7907b17c |
@@ -1,4 +1,6 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
def part_1(input):
|
def part_1(input):
|
||||||
last_number = int(input[0])
|
last_number = int(input[0])
|
||||||
@@ -34,8 +36,9 @@ def alt_solution(input, num_summands):
|
|||||||
|
|
||||||
|
|
||||||
input = list()
|
input = list()
|
||||||
with open('input.txt') as fp:
|
p = Path(__file__).with_name('input.txt')
|
||||||
input = fp.readlines()
|
with open(p) as f:
|
||||||
|
input = f.readlines()
|
||||||
|
|
||||||
part_1(input)
|
part_1(input)
|
||||||
part_2(input)
|
part_2(input)
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
def part_1(input):
|
def part_1(input):
|
||||||
h_pos = 0
|
h_pos = 0
|
||||||
@@ -33,8 +35,8 @@ def part_2(input):
|
|||||||
|
|
||||||
|
|
||||||
input = list()
|
input = list()
|
||||||
with open('input.txt') as fp:
|
p = Path(__file__).with_name('input.txt')
|
||||||
input = fp.readlines()
|
with open(p) as f:
|
||||||
|
input = f.readlines()
|
||||||
part_1(input)
|
part_1(input)
|
||||||
part_2(input)
|
part_2(input)
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
def part_1(input):
|
def part_1(input):
|
||||||
result = 0
|
result = 0
|
||||||
@@ -59,8 +61,8 @@ def part_2(input):
|
|||||||
|
|
||||||
|
|
||||||
input = list()
|
input = list()
|
||||||
with open('input.txt') as fp:
|
p = Path(__file__).with_name('input.txt')
|
||||||
input = fp.readlines()
|
with open(p) as f:
|
||||||
|
input = f.readlines()
|
||||||
part_1(input)
|
part_1(input)
|
||||||
part_2(input)
|
part_2(input)
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
def read_boards(input):
|
def read_boards(input):
|
||||||
boards = list()
|
boards = list()
|
||||||
@@ -129,8 +131,8 @@ def part_2(input):
|
|||||||
|
|
||||||
|
|
||||||
input = list()
|
input = list()
|
||||||
with open('input.txt') as fp:
|
p = Path(__file__).with_name('input.txt')
|
||||||
input = fp.readlines()
|
with open(p) as f:
|
||||||
|
input = f.readlines()
|
||||||
part_1(input.copy())
|
part_1(input.copy())
|
||||||
part_2(input.copy())
|
part_2(input.copy())
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/phon3
|
#!/usr/bin/phyton3
|
||||||
|
from pathlib import Path
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
|
|
||||||
@@ -44,8 +44,8 @@ def part_2(input):
|
|||||||
|
|
||||||
|
|
||||||
input = list()
|
input = list()
|
||||||
with open('input.txt') as fp:
|
p = Path(__file__).with_name('input.txt')
|
||||||
input = fp.readlines()
|
with open(p) as f:
|
||||||
|
input = f.readlines()
|
||||||
part_1(input)
|
part_1(input)
|
||||||
part_2(input)
|
part_2(input)
|
||||||
|
|||||||
9
drone.yml
Normal file
9
drone.yml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: default
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: run
|
||||||
|
image: python
|
||||||
|
commands:
|
||||||
|
- python3 run_all.py
|
||||||
14
run_all.py
Normal file
14
run_all.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
from os import listdir
|
||||||
|
from os.path import isdir, isfile
|
||||||
|
from subprocess import run
|
||||||
|
|
||||||
|
|
||||||
|
for dir in [x for x in listdir('.') if isdir(x)]:
|
||||||
|
file = dir + '/' + dir + '.py'
|
||||||
|
input = dir + '/input.txt'
|
||||||
|
if isfile(file) and isfile(input):
|
||||||
|
print(dir, 'result:')
|
||||||
|
run(["python3", file])
|
||||||
|
|
||||||
11
template.py
11
template.py
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
def part_1(input):
|
def part_1(input):
|
||||||
result = 0
|
result = 0
|
||||||
@@ -15,8 +16,8 @@ def part_2(input):
|
|||||||
|
|
||||||
|
|
||||||
input = list()
|
input = list()
|
||||||
with open('input.txt') as fp:
|
p = Path(__file__).with_name('input.txt')
|
||||||
input = fp.readlines()
|
with open(p) as f:
|
||||||
|
input = f.readlines()
|
||||||
part_1(input)
|
part_1(input)
|
||||||
part_2(input)
|
part_2(input)
|
||||||
|
|||||||
Reference in New Issue
Block a user