Alter 2 files
Update main.py Delete sample.txt
This commit is contained in:
parent
7b894ac8c9
commit
617c90bb14
2 changed files with 19 additions and 22 deletions
|
@ -19,14 +19,21 @@ def modplus(x: int) -> int:
|
|||
return (x + 1) % 4
|
||||
|
||||
|
||||
dirs = [coord.Direction.Up, coord.Direction.Right, coord.Direction.Down, coord.Direction.Left]
|
||||
dirs = [
|
||||
coord.Direction.Up,
|
||||
coord.Direction.Right,
|
||||
coord.Direction.Down,
|
||||
coord.Direction.Left,
|
||||
]
|
||||
|
||||
|
||||
class LoopEncounteredException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def trace(g: grid.Grid, guard_pos: coord.Coordinate, guard_direction: int) -> set[tuple[coord.Coordinate, int]]:
|
||||
def trace(
|
||||
g: grid.Grid, guard_pos: coord.Coordinate, guard_direction: int
|
||||
) -> set[tuple[coord.Coordinate, int]]:
|
||||
visited_sequence = set()
|
||||
|
||||
while guard_pos in g:
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
....#.....
|
||||
.........#
|
||||
..........
|
||||
..#.......
|
||||
.......#..
|
||||
..........
|
||||
.#..^.....
|
||||
........#.
|
||||
#.........
|
||||
......#...
|
Loading…
Add table
Add a link
Reference in a new issue