Giter VIP home page Giter VIP logo

mazes's Introduction

Maze Generator

Here is an online maze generator that can create mazes using square, triangular, hexagonal or circular grids:

Maze using a square grid Maze using a circular grid Maze using a hexagonal grid Maze using a triangular grid

As well as creating mazes the generator has many other features, for example it can render a 'distance map', colouring each location in the grid according how far away it is from a selected point:

Maze distance map

The generator offers a choice of 10 different algorithms, which each produce mazes with different characteristics. All mazes created by these algorithms are 'perfect' mazes, i.e. there is exactly one path connecting any pair of locations within the grid, and therefore one unique solution to each maze.

If you want to try solving one of the mazes yourself then you can! The generator lets you navigate through the maze using mouse/keyboard controls, and can automatically move you forward to the next junction in the maze to save you time. Once you finish a maze your time is displayed, together with an 'optimality score' showing how close your solution was to the optimal one. Of course, you can also give up at any point and see where you should have gone:

Maze game in progress Maze solution

The generator can either create mazes instantly, or slow down the process so that you can watch the algorithms at work. Some algorithms work using a process of trial and error, and can take a long time to finish, whereas others are guaranteed to complete quickly:

By creating a mask you can remove cells from the default grids to create interesting shapes:

Maze using a square grid with masking Maze using a circular grid with masking Maze using a hexagonal grid with masking Maze using a triangular grid with masking

Normally the generator creates a completely unique random maze each time you use it, however if you want to play around with a particular maze without changing the layout then just take a note of the 'Seed Value' that is displayed alongside it. Entering this value into the 'Seed' input field will make sure you get the same pattern again when you click the 'New Maze' button.

If you make a maze that you would like to keep you can download your creation as an SVG file, either with or without the solution displayed.

Many thanks to Jamis Buck for his excellent book Mazes for Programmers which taught me everything I needed to know to make this.

Running Locally

You can try out the maze generator online here. If you want to run your own copy then:

  • Clone the repository, including the 'mazejs' submodule:

    git clone --recurse-submodules [email protected]:codebox/mazes.git

  • Go into the 'mazes' directory:

    cd mazes

  • Start a web server at this location:

    python3 -m http.server

mazes's People

Contributors

codebox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mazes's Issues

Seed Value Problem

Hello,

I don't understand exactly what "Seed Value" is and what it does, or that feature doesn't work.

I tried Ubuntu Local host, it didn't work, I tried it on your demo page and it didn't work.

Seed value is what I understand: to continue with that design after entering the seed number in order not to mask in the next days (I hope I understood it correctly).

Example for a 10x10 square maze on your demo page; "create mask" I did a quick mask, noted the seed number.

I closed the page and opened it again, without changing any settings, I wrote the Seed number, I made a new maze, no it doesn't work, a default 10x10 square maze is formed.

Permission Denied

Hello,
Your codes don't download normally like everyone else's?
I tried on windows and ubuntu systems and failed.
The error message below is the yes command doesn't work. I found the document that needs to be done on the Ubuntu system, but now the error is different from the following error, it gives an access denied warning and I can't do anything.

what is it called subdirectories? is it possible to add them all here?

The authenticity of host 'github.com (140.82.121.4)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wxxxxxF/zLDA0z.........qU.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])?

Feature request: Upload a image to use as mask.

This is a great tool and Thank you for making it.

The only thing I find very cumbersome is clicking on many many cells to try and create a mask. It would great if we could make some shape in Inkscape or other tools and upload it to act as a mask (stretched to fit bounds). So could easy do hearts or car shapes or what have you without being much of an artist or clicking around for ages.

Or if too hard then maybe have an option where moving the mouse over an area toggles cells. I feel like I'm wearing out my mouse button.

Just my two cents and Thanks for listening.

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.