-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
261 additions
and
194 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
numpy | ||
pydantic | ||
requests |
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ ignore = E203,W503,W605,E741 | |
|
||
[mypy] | ||
plugins = pydantic.mypy | ||
ignore_missing_imports = True |
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,35 @@ | ||
# from __future__ import annotations | ||
|
||
from unittest.mock import mock_open, patch | ||
|
||
from y_2024.day10 import Day | ||
|
||
with patch( | ||
"builtins.open", | ||
mock_open( | ||
read_data="""89010123 | ||
78121874 | ||
87430965 | ||
96549874 | ||
45678903 | ||
32019012 | ||
01329801 | ||
10456732 | ||
""", # noqa: E501 | ||
), | ||
): | ||
day = Day() | ||
|
||
|
||
def test__preprocess_input(): | ||
assert True | ||
|
||
|
||
def test_calculate_1(): | ||
r = day._calculate_1() | ||
assert r == 36 | ||
|
||
|
||
def test_calculate_2(): | ||
r = day._calculate_2() | ||
assert r == 81 |
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,27 @@ | ||
# from __future__ import annotations | ||
|
||
from unittest.mock import mock_open, patch | ||
|
||
from y_2024.day11 import Day | ||
|
||
with patch( | ||
"builtins.open", | ||
mock_open( | ||
read_data="""125 17""", # noqa: E501 | ||
), | ||
): | ||
day = Day() | ||
|
||
|
||
def test__preprocess_input(): | ||
assert True | ||
|
||
|
||
def test_calculate_1(): | ||
r = day._calculate_1() | ||
assert r == 55312 | ||
|
||
|
||
def test_calculate_2(): | ||
r = day._calculate_2() | ||
assert r == 65601038650482 |
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,42 @@ | ||
# from __future__ import annotations | ||
|
||
from unittest.mock import mock_open, patch | ||
|
||
from y_2024.day13 import Day | ||
|
||
with patch( | ||
"builtins.open", | ||
mock_open( | ||
read_data="""Button A: X+94, Y+34 | ||
Button B: X+22, Y+67 | ||
Prize: X=8400, Y=5400 | ||
Button A: X+26, Y+66 | ||
Button B: X+67, Y+21 | ||
Prize: X=12748, Y=12176 | ||
Button A: X+17, Y+86 | ||
Button B: X+84, Y+37 | ||
Prize: X=7870, Y=6450 | ||
Button A: X+69, Y+23 | ||
Button B: X+27, Y+71 | ||
Prize: X=18641, Y=10279 | ||
""", # noqa: E501 | ||
), | ||
): | ||
day = Day() | ||
|
||
|
||
def test__preprocess_input(): | ||
assert True | ||
|
||
|
||
def test_calculate_1(): | ||
r = day._calculate_1() | ||
assert r == 480 | ||
|
||
|
||
def test_calculate_2(): | ||
r = day._calculate_2() | ||
assert r == 875318608908 |
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,27 @@ | ||
# from __future__ import annotations | ||
|
||
from unittest.mock import mock_open, patch | ||
|
||
from y_2024.day9 import Day | ||
|
||
with patch( | ||
"builtins.open", | ||
mock_open( | ||
read_data="""2333133121414131402""", # noqa: E501 | ||
), | ||
): | ||
day = Day() | ||
|
||
|
||
def test__preprocess_input(): | ||
assert True | ||
|
||
|
||
def test_calculate_1(): | ||
r = day._calculate_1() | ||
assert r == 1928 | ||
|
||
|
||
def test_calculate_2(): | ||
r = day._calculate_2() | ||
assert r == 2858 |
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
Oops, something went wrong.