Algorithm for a Maze - Hsanokklis/2023-2024-Tech-journal GitHub Wiki

Let's explore how we would design an algorithm for navigating a maze.

image

We are going to tackle a harder problem than just navigating this specific maze. Instead, we are going to try to design an algorithm to solve ANY maze.

Can you figure out HOW to solve ANY maze?

Can you TELL someone else how to solve any maze?

Assume the person you are giving instructions to can do certain operations:

  • Draw a path with a pencil
  • Can draw straight, turn left, turn right, turn around
  • Detect walls, dead ends, and junctions
  • Detect where you’ve drawn a line

What approach would you take?