Giter VIP home page Giter VIP logo

prbasha / mazegenerator Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 34 KB

A random maze generator. Based on the Recursive Backtracker algorithm. Implemented in C# .NET WPF.

License: GNU General Public License v3.0

C# 100.00%
csharp dotnet wpf mvvm recursion recursive recursive-algorithm backtracking backtracking-algorithm recursive-backtracking recursive-backtracker recursive-backtracking-algorithm graphics xaml maze maze-generator maze-generation-algorithms

mazegenerator's Introduction

MazeGenerator

A random maze generator. Based on the Recursive Backtracker algorithm.

  1. The maze begins as a grid of cells, with an empty stack.
  2. Choose a random initial cell from the grid:
    1. Set this as the current cell and mark it as visited.
  3. While there are unvisited cells in the grid:
    1. If the current cell has any unvisited neighbour cells:
      1. Choose a random unvisited neighbour cell.
      2. Remove the wall between the current cell and the chosen neighbour cell.
      3. Push the current cell onto the stack.
      4. Set the chosen neighbour cell as the current cell and mark it as visited.
      5. Repeat step 3, with the new current cell.
    2. Else the current cell has no unvisited neighbour cells:
      1. Pop a cell from the stack, and set it as the current cell.
      2. Repeat step 3, with the new current cell.

A random maze is generated, with start and end locations.

For more information: https://en.wikipedia.org/wiki/Maze_generation_algorithm#Recursive_backtracker http://weblog.jamisbuck.org/2010/12/27/maze-generation-recursive-backtracking

mazegenerator's People

Contributors

prbasha avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

darocha

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.