Hacker News new | ask | show | jobs
by shiift 4444 days ago
Is there a reason why it will continue searching "down" once it hits the right edge (and "left" if it hits the top edge)? I'm just curious.
2 comments

Imagine you're in a maze. Do you know where you are in relation to the maze's boundaries at any point?
I guess that makes sense. I was thinking of it as a maze that someone would using a pencil on paper, but if it were a real maze with high walls it would make sense that you wouldn't necessarily know when you've reached a side.
Exactly - this seems like an obvious and easy improvement to the algorithm.