File tree 2 files changed +14
-10
lines changed
2024/python/src/grice_py_aoc_2024/templates
2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -7,24 +7,28 @@ DIR = Path(__file__).parent
7
7
FILE = DIR.parents[3] / "inputs" / f"{DIR.stem}.txt"
8
8
9
9
10
- def part1(contents: str):
11
- return "Not done yet!"
10
+ def part1(contents: str) -> int:
11
+ total = 0
12
+ # TODO part 1
13
+ return total
12
14
13
15
14
- def part2(contents: str):
15
- return "Not done yet!"
16
+ def part2(contents: str) -> int:
17
+ total = 0
18
+ # TODO part 2
19
+ return total
16
20
17
21
18
22
def main():
19
23
contents = FILE.read_text()
20
24
21
25
_start1 = time.perf_counter()
22
- result1 = part1(contents)
26
+ result1 = part1(contents=contents )
23
27
_delta1 = time.perf_counter() - _start1
24
28
print(f">> Part 1: {result1} ({_delta1:.6f}s)")
25
29
26
30
_start2 = time.perf_counter()
27
- result2 = part2(contents)
31
+ result2 = part2(contents=contents )
28
32
_delta2 = time.perf_counter() - _start2
29
33
print(f">> Part 2: {result2} ({_delta2:.6f}s)")
30
34
Original file line number Diff line number Diff line change @@ -8,18 +8,18 @@ from .main import part1, part2
8
8
9
9
DIR = Path(__file__).parent
10
10
TEST_FILE = DIR.parents[3] / "inputs/tests" / f"test_{DIR.stem}.txt"
11
- EXPECTED_PART_1 = "REPLACE ME!"
12
- EXPECTED_PART_2 = "REPLACE ME!"
11
+ EXPECTED_PART_1 = 123 # TODO replace!
12
+ EXPECTED_PART_2 = 456 # TODO replace!
13
13
14
14
15
15
def test_part1():
16
16
contents = TEST_FILE.read_text()
17
- result = part1(contents)
17
+ result = part1(contents=contents )
18
18
assert result == EXPECTED_PART_1
19
19
20
20
21
21
@pytest.mark.xfail(reason=f"{DIR.stem} P1 incomplete")
22
22
def test_part2():
23
23
contents = TEST_FILE.read_text()
24
- result = part2(contents)
24
+ result = part2(contents=contents )
25
25
assert result == EXPECTED_PART_2
You can’t perform that action at this time.
0 commit comments