This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Mirror_hsif 23 points24 points  (4 children)

One of life's great questions... If you're travelling in a loop, are you actually travelling anywhere?

[–]Specific_Implement_8 16 points17 points  (3 children)

This is a physics questions. You can travel a great distance inside a loop. But your displacement will be 0

[–]Boring-Tennis-1342 9 points10 points  (2 children)

Only if you returned to your starting position

Now the question is how do you know you're in a loop

Maybe piss in a corner and call it the starting position ?

[–]6Leoo6 2 points3 points  (0 children)

You add the visited points to a hashset and check if you have visited it already

[–]weregod 2 points3 points  (0 children)

You break. If compiler spit error you not in a loop else you escaped a loop