This project is a Python implementation of a maze-solving algorithm for a mouse to find a piece of cheese. The goal is to find the shortest path possible for the mouse to reach the cheese.
To run the code, follow these steps:
-
Clone the repository:
git clone https://github.com/quang14github/ruse-ai-task1
-
Navigate to the project directory:
cd ruse-ai-task1
-
Make sure that you have Python and pip:
python --version
or
python3 --version
and
pip --version
or
pip3 --version
-
Install matplotlib library:
pip install matplotlib
-
Run the
main.py
script:python main.py
The algorithm used in this project is a modified version of the breadth-first search (BFS) algorithm. It explores all possible paths from the starting point (mouse) to the destination (cheese) in a maze.
- Modify the matrix variable to represent your maze. The maze should be a rectangular grid, where each character represents a cell. Use the following symbols:
1
: Wall (impassable)0
: Path (passable)
- Modify the
start
anddestination
:
start = (3,0)
dest = (3,3)