Skip to content

douglasgimli/maze-generator-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Maze Generator

Hunt and Kill Algorithm Implementation

This is a repository with only and one purpose: STUDYING. So don't expect to find any rocket science code in here (maybe just a virtual rocket to blow the maze).

I went out of coding for a few months while I've dedicated myself to full-time entrepreneurship running a tech company, but as any developer from heart, code was bowling in my veins, so I've needed to back coding anyhow.

While reading a few posts on twitter and Reddit I came across @munificent's blog post about "Rooms and Mazes: A Procedural Dungeon Generator" and I got amazed by the great content and challenge there presented, so a few hours later there I was buying an IDE to iPad (thanks play.js!) and having my first line of codes being written.

I got to be honest, was not easy to implement even the easiest part of the tutorial, not because of the algorithm itself, but I got scrambled for a few hours trying to figure out a solution to print the map with the walls and floor tiles. So I've made some research and I've found other great posts related to maze algorithms:

Maze Classification by Walter D. Pullen

Maze Generation: Hunt-and-Kill algorithm by Jamis Buck

Visualizing Algorithms by Mike Bostock

And there it was, the solution was simple as the question, I was focusing myself on the walls and tiles, but I've should also care about the connections, so I few minutes after this revelation my first ever maze code generated using the hunt and kill algorithm was completed.

This is yet a work in progress, I'm still wondering if it will progress to a full game or not, so let's see...

Usage

node ./maze-generator.js

Visual Output

Maze Generator

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published