jamis / csmazes Goto Github PK
View Code? Open in Web Editor NEWMaze algorithms implemented in CoffeeScript, with an eye toward demonstrating how the algorithms work by animating them.
Maze algorithms implemented in CoffeeScript, with an eye toward demonstrating how the algorithms work by animating them.
As a workaround, you can install CoffeeScript 1
npm install --save-dev [email protected]
or globally (sudo on Mac)
sudo npm install -g [email protected]
Hi. I'm not sure if this is the appropriate place to post this but I think there is a mistake in your Eller's maze description on pages 190 to 192 in your book "Mazes For Programmers."
On page 191 after carving south into the second row of the maze, you don't do anything to prevent loops from forming in the maze. Your illustration doesn't include any loops but in the last diagram on page 191 take a look at cells 6 and 1. There is no reason those two cells could not be joined together (they are adjacent and differen't sets) assuming your random integer is a 0. This would cause all four of the upper right corners of the maze to be connected in a loop.
EDIT: Ooops I made a mistake. Joining those cells like I suggested would NOT create a loop;
I noticed while running the maze examples that the "hunt and kill" algorithm, during the "huntStep" (state 2), checks ever column of every row, starting with (0,0), for a cell that responds to isBlank
. This check can go on for many rows. Once it finds a cell, it performs a "walkStep" (state 1) and begins the search process all over again, starting at row 0. This is very inefficient and easily fixed.
I propose that after each row where no cell responded to isBlank
, increment a "processed rows" counter and start from that row on the next searching step. Of course, this is a very simple approach to fix this inefficiency. A more complex approach would also increment/reset column numbers within the row, and an even more complex approach could just increment a "processed cells" number every time one is seen or started and then take the modulo of that number and the number of columns to retrieve an exact starting position.
This will make for easier searching and it will mean it can be more easily grouped with other similar projects.
I recommend adding the "maze" topic, but other topics such as "CofeeScript" and "generator" may be suitable too.
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.