Maze is generated using hunt-and-kill algorithm.
Path finding is based on depth-first search algorithm.
Drawing is based on HTML canvas.
Feel free to use the code in this repository as it is under MIT license.
A maze generator and path finder in Angular
Home Page: https://changhuixu.github.io/angular-maze/
License: MIT License
Maze is generated using hunt-and-kill algorithm.
Path finding is based on depth-first search algorithm.
Drawing is based on HTML canvas.
Feel free to use the code in this repository as it is under MIT license.
Hello,
I stumbled across this repo in search of maze algorithm implementations. I tried translating your code to Lua but I could not get the algorithm to work. For whatever reason, the algorithm would only generate zigzag patterns with a few joining cells...
Since then, I stumbled across the Aldous-Broder algorithm which you may find useful. The algorithm is the following:
// semi-pseudocode (translating from Lua to JS-like)
var visited = new Set();
function visit(cell) {
cell.isVisited = true
visited.add(cell)
}
function hasUnvisitedCells() {
return visited.size < numberOfColumns * numberOfRows
}
function generate() {
var cell = this.getRandomCell()
visit(cell)
while (this.hasUnvisitedCells()) {
var neighbor = cell.neighbors.shuffle().first()
if (!neighbor.isVisited) {
cell.connect(neighbor)
this.visit(neighbor)
}
cell = neighbor
}
}
Cheers!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.