Git Product home page Git Product logo

maze-generator-solver-in-java's Introduction

Maze Generater and Solver in JAVA

Introduction

This is a Java program that generates and solves mazes using recursive backtracking algorithm. The program creates a maze of a specified size and then solves it by finding the shortest path from the starting point to the ending point.

Features

  • Generates a random maze using depth-first search algorithm.
  • Solves the maze by finding a path from the start to the end using recursive backtracking algorithm.
  • The maze is displayed graphically on a JPanel.
  • The maze can be customized by changing various parameters, such as the number of rows and columns, the size of each cell, and the minimum number of pixels between the maze and the edge of the panel.

Prerequisities

  • Java Development Kit (JDK) version 8 or higher.
  • An integrated development environment (IDE) that supports Java, such as Eclipse or IntelliJ IDEA.

Installing

Clone : git clone https://github.com/OpenGenus/maze-generator-solver-in-java.git

or download the repository (zip file) to your local machine.

Running

  • Compile the Maze.java file using the Java compiler.
    javac Maze.java
  • Run the Maze class using the Java Virtual Machine.
    java Maze

Customization

You can customize various aspects of the maze by changing the following variables in the Maze class:

  • rows: number of rows of cells in the maze, including a wall around edges.
  • columns: number of columns of cells in the maze, including a wall around edges.
  • blockSize: size of each cell in pixels.
  • border: minimum number of pixels between the maze and the edge of the panel.
  • sleepTime: wait time after solving one maze before making another.
  • speedSleep: short delay between steps in making and solving maze.

maze-generator-solver-in-java's People

Contributors

adichat avatar

Watchers

 avatar  avatar

Forkers

sankarxace

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.