Skip to content

AWass04/Rat-Maze-DFS-Algorithm-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Rat Maze (DFS Algorithm)

I have been tasked to create an algorithm that replicates the rat-in-a-maze experiment in C#.

In this expermiement, The rat or mouse makes its way through the maze while being carefully observed by scientists until it eventually reaches the exit at which it is rewarded with food.

Criteria

The following criteria needed to be met:

  • '0' represents a path
  • '1' represents a wall
  • The maze must have an enterance an exit.
  • The maze must be surrounded by walls.
  • The enterance must close off after the rat enters.
  • Although an exit is required if there is no exit an error must produce.
  • The rat must be able to travel 8 directions: North, North-east, East, South-east, South, South-West, West, North-West
  • A set of paths to the exit must be displayed.

All criteria in my program has been met.

Additional features

Although not required by the criteria, I have included an extra maze to show extra functionality of my maze and made it so it will regularly print the maze to clearly show what is happening. Plus, it will display what the shortest path to the exit is.