Day 6 part 2 solution.

This commit is contained in:
2024-12-07 01:36:54 +10:00
parent baf45b78d1
commit f1c5694d26
2 changed files with 86 additions and 7 deletions

View File

@@ -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()