-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #155 from GriceTurrble/chore/2024-03-py-scaffolded
chore: 2024 day 03 python scaffolded
- Loading branch information
Showing
10 changed files
with
73 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from __future__ import annotations | ||
|
||
import time | ||
from pathlib import Path | ||
|
||
FILE = Path(__file__).parent / "inputs.txt" | ||
|
||
|
||
def part1(contents: str): | ||
return "Not done yet!" | ||
|
||
|
||
def part2(contents: str): | ||
return "Not done yet!" | ||
|
||
|
||
def main(): | ||
contents = FILE.read_text() | ||
|
||
_start1 = time.perf_counter() | ||
result1 = part1(contents) | ||
_delta1 = time.perf_counter() - _start1 | ||
print(f">> Part 1: {result1} ({_delta1:.6f}s)") | ||
|
||
_start2 = time.perf_counter() | ||
result2 = part2(contents) | ||
_delta2 = time.perf_counter() - _start2 | ||
print(f">> Part 2: {result2} ({_delta2:.6f}s)") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from __future__ import annotations | ||
|
||
from pathlib import Path | ||
|
||
from .main import part1, part2 | ||
|
||
TEST_FILE_P1 = Path(__file__).parent / "test_inputs_p1.txt" | ||
TEST_FILE_P2 = Path(__file__).parent / "test_inputs_p2.txt" | ||
EXPECTED_PART_1 = "Now it's done!" | ||
EXPECTED_PART_2 = "Now it's done!" | ||
|
||
|
||
def test_part1(): | ||
contents = TEST_FILE_P1.read_text() | ||
result = part1(contents) | ||
assert result == EXPECTED_PART_1 | ||
|
||
|
||
def test_part2(): | ||
contents = TEST_FILE_P2.read_text() | ||
result = part2(contents) | ||
assert result == EXPECTED_PART_2 |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters