{"id":13831823,"url":"https://github.com/jamis/csmazes","last_synced_at":"2025-11-11T20:51:51.518Z","repository":{"id":1285780,"uuid":"1225530","full_name":"jamis/csmazes","owner":"jamis","description":"Maze algorithms implemented in CoffeeScript, with an eye toward demonstrating how the algorithms work by animating them.","archived":false,"fork":false,"pushed_at":"2018-10-28T17:32:09.000Z","size":69,"stargazers_count":393,"open_issues_count":0,"forks_count":42,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-05-20T04:03:19.996Z","etag":null,"topics":["generator","maze","maze-algorithms"],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-01-06T05:46:09.000Z","updated_at":"2025-03-09T12:55:38.000Z","dependencies_parsed_at":"2022-08-16T12:55:17.105Z","dependency_job_id":null,"html_url":"https://github.com/jamis/csmazes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jamis/csmazes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamis%2Fcsmazes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamis%2Fcsmazes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamis%2Fcsmazes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamis%2Fcsmazes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamis","download_url":"https://codeload.github.com/jamis/csmazes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamis%2Fcsmazes/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266618859,"owners_count":23957273,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["generator","maze","maze-algorithms"],"created_at":"2024-08-04T10:01:41.173Z","updated_at":"2025-11-11T20:51:51.461Z","avatar_url":"https://github.com/jamis.png","language":"CoffeeScript","funding_links":[],"categories":["CoffeeScript"],"sub_categories":[],"readme":"CoffeeScript Mazes\n==================\n\nThere are a lot of different maze algorithms out there, each with different\nproperties, strengths, weaknesses, and interesting points. The aim of this\nproject is to develop a library of these algorithms in a format that allows\nthe inner structure and behavior of them to be studied and observed\nvisually, by animating them and allowing students to step through them.\n\n\nInstallation\n------------\n\nYou'll need [CoffeeScript](http://coffeescript.org) installed. Once you've\ngot that, you can run:\n\n    cake build\n\nThis will convert the CoffeeScript sources in the \"src\" directory, to\nJavascript files in the \"lib\" directory.\n\nAt this point you should be able to open the demo in examples/maze.html.\n(A possibly-out-of-date version of the demo can be seen\n[here](http://jamisbuck.org/mazes), if you want to get an idea of what\ncsMazes can do.)\n\nIf you want to do a piecemeal installation of your own, you'll need at least\nthese files, included in this order:\n\n* mersenne.js\n* maze.js\n\nFurther, the \"widget.js\" includes a script for easily embedding maze animations\non your page; you just need to add the CSS definitions. (See examples/maze.html\nfor the CSS definitions.)\n\nOnce you've included those files, you can include any of the algorithm-specific\nfiles you want.\n\nAlso, these files may be safely combined and minified, if you want to reduce\neverything to a single file.\n\n\nUsage\n-----\n\nUsing the included widget, embedding a maze is as simple as this:\n\n    \u003cscript type=\"text/javascript\"\u003e\n      Maze.createWidget(\"Prim\", 10, 10)\n    \u003c/script\u003e\n\nThis would embed a 10x10 grid that will animate Prim's algorithm. You can also\npass an optional object (hash) with properties to customize how the algorithm\nruns, or how the grid is displayed. These properties are supported:\n\n* **id** : used to set the id of the created HTML elements. If not specified,\n  the lower-cased   algorithm name will be used.\n* **class** : the HTML class attribute to add to the outermost generated\n  div. This is in addition to any other classes that the widget itself\n  assigns (e.g. \"maze\").\n* **input** : data that should be passed to the maze object upon creation.\n  This should be either a string, in which case it is passed directly to the\n  maze constructor, or a function, in which case it is invoked first and\n  the return value used as the value passed to the maze. The actual format\n  of the string is dependent on the algorithm used.\n* **interval** : the delay (in milliseconds) between steps when the maze\n  is in \"run\" mode. Defaults to 50ms.\n* **wallwise** : a boolean value indicating whether the maze is to be\n  displayed as a passage carver (false) or a wall adder (true). The meaning\n  of the wall queries is inverted when wallwise is true. Most mazes\n  need to have wallwise set to false (the default), but the RecursiveDivision\n  algorithm is a wall adder and needs to be rendered with wallwise set to\n  true.\n* **seed** : an integer value to use as a seed for the random number generated.\n  Using the same seed for different animation runs (where the algorithm and\n  dimensions are otherwise the same) will always result in the same maze\n  being generated.\n* **rng** : the random number generator object to use to generate numbers.\n  You'll almost never need to use this; but it could be handy if you want to\n  generate a series of mazes with the same original seed. If used, this should\n  be an instance of MersenneTwister (defined in mersenne.coffee), or should\n  at least conform to the same interface.\n* **padded** : if true, adds space around each cell. The default is false.\n* **weave** : if true, generates a \"weave\" maze (where passages move over\n  and under other passages). This is not supported by all algorithms. For\n  best results, use with **padded** set to true.\n* **weaveMode** : either, \"onePhase\" (the default), or \"twoPhase\". Only\n  Kruskal's algorithm currently supports this setting.\n* **weaveDensity** : A number between 0 and 100 (default 80), with 100\n  meaning \"maximum\" density\". Only used when **weaveMode** is set to\n  \"twoPhase\".\n\nAdvanced Usage\n--------------\n\nIf you're determined to do things the hard way, you can always instantiate\nthe mazes yourself, setting up the callbacks and rendering things manually.\nTo instantiate a maze:\n\n    var maze = new Maze(10, 10, Maze.Algorithms.Prim)\n\nThis would create a blank 10x10 grid that will generate a maze using Prim's\nalgorithm. Mazes are generated either step-wise:\n\n    maze.step() // returns false when the maze is completed\n\nOr they can be generated all at once:\n\n    maze.generate() // calls step() repeatedly until done\n\nAs with the widget helper, the maze constructor accepts an optional final\nparameter, an object, whose properties can be used to customize how the\nmaze is built. The following properties are understood (and have the same\nmeaning as their counterparts in the widget helper):\n\n* **input** : a string used as input to the algorithm, which can be used to\n  customize its behavior. Not all algorithms use this parameter.\n* **seed**\n* **rng**\n* **weave**\n* **weaveMode**\n* **weaveDensity**\n\nTo indicate interest in the progress of the maze, you can use the onUpdate and\nonEvent methods to register callbacks that will be invoked. The onUpdate\ncallback is triggered every time a cell is changed. The onEvent callback is\ntriggered whenever an algorithm-dependent \"event\" occurs (e.g. the recursive\nbacktracker hits a dead-end and has to backtrack). Both callbacks accept three\nparameters: the maze object that caused the callback, and the x and y coordinates\nthat are relevant.\n\n    maze.onUpdate(function(m, x, y) {\n      // update the display, etc.\n    });\n\n    maze.onEvent(function(m, x, y) {\n      // pause the animation, etc.\n    });\n\nLicense\n-------\n\ncsMazes is written by Jamis Buck (jamis@jamisbuck.org) and is made available\nin the public domain. Do with it what you will.\n\nBut please prefer good over evil.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamis%2Fcsmazes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamis%2Fcsmazes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamis%2Fcsmazes/lists"}