Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dba9dab

Browse files
committed
Revert "2024-12-06: part two: refactor: fixup for positioning of loop-inducing obstacles"
This reverts commit 226e96a.
1 parent e0e0b92 commit dba9dab

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

2024/06/06.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ def would_loop(hypothetical_position, hypothetical_direction):
7373

7474
# hypothetical: would the guard revisit a previous location + direction if they rotated and continued from here?
7575
if would_loop(guard_position, rotate(guard_direction)):
76-
loop_obstacle_position = (guard_y + move_y, guard_x + move_x)
77-
loop_obstacles[loop_obstacle_position] = True
76+
loop_obstacles[guard_position] = True
7877

7978
print_map()
8079

0 commit comments

Comments
 (0)