Day 6 part 2 solution.
This commit is contained in:
10
day6/test.py
10
day6/test.py
@@ -1,4 +1,4 @@
|
||||
from solver import Simulation
|
||||
from solver import Simulation, find_good_obstacles
|
||||
|
||||
|
||||
test_data = r"""
|
||||
@@ -22,6 +22,14 @@ def test_visited():
|
||||
assert visited == 41
|
||||
print("Visited test passed")
|
||||
|
||||
def test_loop_obstacles():
|
||||
print("Beginning loop inducing obstacle placement test")
|
||||
sim = Simulation.from_string(test_data)
|
||||
places = find_good_obstacles(sim)
|
||||
assert len(places) == 6
|
||||
print(f"Loop inducing obstacle placement test complete")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
test_visited()
|
||||
test_loop_obstacles()
|
||||
|
||||
Reference in New Issue
Block a user