Maze Solver

Exit No Exit

The maze solver is a small C++ console application made to locate a maze’s exit (if one exists). It’s currently configured to except any 12 x 12 maze written to a text file.

    Mazes

    The mazes are constructed from a text file of 1s (walls) and 0s (empty spaces). The application solves the maze by following the right-hand rule. The following are a couple of maze examples that adhere to the right-hand rule:

    Exit                        No Exit
    
    1 1 1 1 1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1 1 1 1 1
    1 0 0 0 1 0 0 0 0 0 0 1     1 0 0 0 1 0 0 0 0 0 0 1
    0 0 1 0 1 0 1 1 1 1 0 1     1 0 1 0 1 0 1 1 1 1 0 1
    1 1 1 0 1 0 0 0 0 1 0 1     1 1 1 0 1 0 0 0 0 1 0 1
    1 0 0 0 0 1 1 1 0 1 0 0     1 0 0 0 0 1 1 1 0 1 0 1
    1 1 1 1 0 1 0 1 0 1 0 1     1 1 1 1 0 1 0 1 0 1 0 1
    1 0 0 1 0 1 0 1 0 1 0 1     1 0 0 1 0 1 0 1 0 1 0 1
    1 1 0 1 0 1 0 1 0 1 0 1     1 1 0 1 0 1 0 1 0 1 0 1
    1 0 0 0 0 0 0 0 0 1 0 1     1 0 0 0 0 0 0 0 0 1 0 1
    1 1 1 1 1 1 0 1 1 1 0 1     1 1 1 1 1 1 0 1 1 1 0 1
    1 0 0 0 0 0 0 1 0 0 0 1     1 0 0 0 0 0 0 1 0 0 0 1
    1 1 1 1 1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1 1 1 1 1
    

    Source

    September 13, 2010