3 ms·
My three year old taught me something he saw on a YouTube video: you can search through a maze and find your way out just by keeping your right hand on the wal
by efavdb 3mo ago
My three year old taught me something he saw on a YouTube video: you can search through a maze and find your way out just by keeping your right hand on the wall at all times and continuing till exit. Does a DFS.
- LeoPanthera 3mo agoThis only works for two dimensional mazes where both the entrance and exit are on an edge and there are no loops in the maze. If you introduce a bridge, or a tunnel, or put the goal in the middle, you can get stuck in a loop.
- CGamesPlay 3mo agoThrow a loop/island in the maze and see how your kid reacts.
- mohamedkoubaa 3mo agoI vaguely recall a windows screensaver that did this
- RataNova 3mo agoA nice case of an algorithm being easier to learn physically than abstractly
- OkayPhysicist 3mo agoAnother nifty maze solving trick: Using flood-fill in Paint or some such, starting at the entrance, paint the wall on one side of the entrance red, and the other blue. You'll find that the border between the red and blue sections (the path where one wall is red and the other is blue) is the path to the exit. If there are loops, then you'll end up with uncolored squares, but you can just treat those as blue if you follow the red edge.