28 lines
426 B
Python
28 lines
426 B
Python
from solver import Simulation
|
|
|
|
|
|
test_data = r"""
|
|
....#.....
|
|
.........#
|
|
..........
|
|
..#.......
|
|
.......#..
|
|
..........
|
|
.#..^.....
|
|
........#.
|
|
#.........
|
|
......#...
|
|
""".strip()
|
|
|
|
def test_visited():
|
|
print("Beginning visited test")
|
|
sim = Simulation.from_string(test_data)
|
|
sim.run()
|
|
visited = sim.total_visited()
|
|
assert visited == 41
|
|
print("Visited test passed")
|
|
|
|
|
|
if __name__ == '__main__':
|
|
test_visited()
|