Another idea is to count the visits of each cell. After 4 you know that you went at least twice from the same direction into a certain cell.
1 Like
Another idea is to count the visits of each cell. After 4 you know that you went at least twice from the same direction into a certain cell.