Skip to content

Fun maze generating/solving app project for Java practice

Notifications You must be signed in to change notification settings

kamkali/Maze-Runner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 

Repository files navigation

Maze-Runner

This is a repository for the Maze Runner project. It was implemented in Java. The main goal was to practice Java, data structures and algorithms.

Compile'n'Run

Example compilation and run:

javac -d bin src/*.java
java -classpath bin Main

Description

The project consists of a couple of components:

  1. Random maze generator – the maze is represented as a grid (two-dimensional array of Cell objects). The Depth-First Search algorithm implemented as recursive backtracker is used to go through a grid and generate passes and walls.
  2. Breadth-First Search algorithm to find all neighboring vertices with the path cost for every graph node to represent maze as a graph
  3. Dijkstra's Shortest Path First algorithm to solve a graph and find a path from entry to exit

Usage

When run, the user can generate a random maze. The app will ask for a dimension. The valid dimension range is <2,65>.

Zrzut ekranu 2020-02-19 o 20 40 21

The generated maze can be solved using the next option. The path will be marked on the maze and the shortest path from entry to exit through graph vertices will be displayed.

Zrzut ekranu 2020-02-19 o 20 40 30

Notes

The project and algorithms do not aim for efficiency or speed. That's why you should avoid generating too big mazes (may cause memory flood or can take some time to solve!). Its purpose was to get familiar with simple algorithms and to follow them step by step. In some cases, they are slightly changed to meet my curiosity and requirements.

Author

Releases

No releases published

Packages

No packages published

Languages