logoalt Hacker News

efavdbtoday at 1:09 AM4 repliesview on HN

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.


Replies

LeoPantheratoday at 1:26 AM

This 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.

RataNovatoday at 7:06 AM

A nice case of an algorithm being easier to learn physically than abstractly

CGamesPlaytoday at 1:28 AM

Throw a loop/island in the maze and see how your kid reacts.

mohamedkoubaatoday at 1:36 AM

I vaguely recall a windows screensaver that did this