Git Product home page Git Product logo

kumarroshan123 / terminal_based_maze_solver Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 7 KB

The "Terminal Based Maze Solver" project is a Python implementation featuring a maze generator and a depth-first search algorithm to find a solvable path from the starting to the ending point in a randomly generated maze. The program provides a user-friendly console interface for interaction and exploration of maze solutions.

Python 100.00%
2d-arrays algorithm-design backtracking-algorithm dfs-algorithm dsa-algorithm list-manipulation oops-in-python python3 random-number-generators recursion stack user-interaction

terminal_based_maze_solver's Introduction

Terminal_Based_Maze_Solver

Overview

The "Terminal Based Maze Solver" project is a Python implementation of a maze generation and solving algorithm. The project includes a maze generator that creates a random maze with a specified size and starting (S) and ending (E) points. Additionally, it features a depth-first search (DFS) algorithm to find a path from the starting point to the ending point in the generated maze.

Components

Maze Generation

The maze generation utilizes a stack-based algorithm to create a random maze. The algorithm ensures that there is only one path between the starting and ending points, making the maze solvable. The generated maze consists of cells marked as follows:

0: Wall(▓) 1: Open path(◌) 2: Starting point (S) 3: Ending point (E) 4: Path(◍)

Depth-First Search (DFS)

The DFS algorithm is employed to find a path from the starting point to the ending point in the generated maze. The DFS explores possible paths, backtracking when necessary, until it successfully reaches the destination. The path is then displayed, and the maze with the path is printed.

User Interaction

The user can interact with the program through a simple console interface with the following options:

  1. Print the Path: Display the solution path in the generated maze.
  2. Generate Another Puzzle: Create a new random maze.
  3. Exit the Game: Terminate the program.

Clone repository from github

  • bash git clone https://github.com/kumarroshan123/Terminal_Based_Maze_Solver.git

How to Run

To run the program, execute the Python script. Upon launching, the user will be prompted to enter the size of the maze. The program will then display the maze and provide options for interacting with the generated puzzle.

Dependencies

The project has no external dependencies beyond the standard Python library.

Additional Notes

  1. The maze generator ensures that there is a solvable path from the starting point to the ending point.
  2. The DFS algorithm employs a recursive approach to explore possible paths within the maze.
  3. The solution path is marked with a different symbol ("-1") in the displayed maze.

Output_Screenshots

Screenshot 2024-01-17 233755 Screenshot 2024-01-17 234115

terminal_based_maze_solver's People

Contributors

kumarroshan123 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.