This repository has been archived by the owner on Oct 1, 2024. It is now read-only.
-
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.
Signed-off-by: Mukund Venkatachar <mukund.venkatachar@gmail.com>
- Loading branch information
Showing
4 changed files
with
104 additions
and
46 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
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,35 +1,30 @@ | ||
import os | ||
|
||
from .day22 import part1, get_input | ||
from .day22 import run | ||
|
||
data1 = open(os.getcwd() + '//day22//day22_example1.txt').read() | ||
data2 = open(os.getcwd() + '//day22//day22_example2.txt').read() | ||
data3 = open(os.getcwd() + '//day22//day22_example2.txt').read() | ||
data3 = open(os.getcwd() + '//day22//day22_example3.txt').read() | ||
|
||
|
||
class TestDay22: | ||
|
||
def test_part1_example_1(self): | ||
ans = part1(*get_input(data=data1, day=21, year=2021)) | ||
ans = run(data=data1, day=22, year=2021, part=1) | ||
assert ans == 39 | ||
|
||
def test_part1_example_2(self): | ||
ans = part1(*get_input(data=data2, day=21, year=2021)) | ||
ans = run(data=data2, day=22, year=2021, part=1) | ||
assert ans == 590784 | ||
|
||
# def test_part1_example_3(self): | ||
# ans = part1(*get_input(data=data3, day=21, year=2021)) | ||
# assert ans == 2758514936282235 | ||
# def test_part2_example(self): | ||
# p1, p2 = get_input(data=data, day=21, year=2021) | ||
# ans = part2(play_dirac_dice(p1, p2, 0, 0)) | ||
# assert ans == 444356092776315 | ||
# | ||
# def test_part1(self): | ||
# ans = play_deterministic_dice(get_input(data=None, day=21, year=2021)) | ||
# assert ans == 734820 | ||
# | ||
# def test_part2(self): | ||
# p1, p2 = get_input(data=None, day=21, year=2021) | ||
# ans = part2(play_dirac_dice(p1, p2, 0, 0)) | ||
# assert ans == 193170338541590 | ||
def test_part2_example_1(self): | ||
ans = run(data=data3, day=22, year=2021, part=2) | ||
assert ans == 2758514936282235 | ||
|
||
def test_part1(self): | ||
ans = run(data=None, day=22, year=2021, part=1) | ||
assert ans == 583636 | ||
|
||
def test_part2(self): | ||
ans = run(data=None, day=22, year=2021, part=2) | ||
assert ans == 1294137045134837 |
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