{"id":16341802,"url":"https://github.com/adimit/amazegen","last_synced_at":"2025-09-11T12:38:34.984Z","repository":{"id":66452557,"uuid":"588323304","full_name":"adimit/amazegen","owner":"adimit","description":"A simple maze generator.","archived":false,"fork":false,"pushed_at":"2025-03-18T06:07:36.000Z","size":988,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-18T15:54:20.578Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://aleks.bg/maze","language":"Rust","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/adimit.png","metadata":{"files":{"readme":"Readme.org","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-12T21:13:34.000Z","updated_at":"2025-03-18T06:07:40.000Z","dependencies_parsed_at":"2025-03-03T21:29:38.789Z","dependency_job_id":"fc62692b-91fa-4b45-866c-af31e624382c","html_url":"https://github.com/adimit/amazegen","commit_stats":{"total_commits":204,"total_committers":1,"mean_commits":204.0,"dds":0.0,"last_synced_commit":"3d29d2ab301d94b8689f076ccbdd0456c02d1987"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adimit%2Famazegen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adimit%2Famazegen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adimit%2Famazegen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adimit%2Famazegen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adimit","download_url":"https://codeload.github.com/adimit/amazegen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245040235,"owners_count":20551297,"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","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":[],"created_at":"2024-10-11T00:00:24.174Z","updated_at":"2025-03-23T00:32:33.936Z","avatar_url":"https://github.com/adimit.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"* A Maze Generator\n\n** Mission Statement\nA collection of maze generation algorithms, interesting visualisations, and a web interface UI. The algorithms and visualisations are written in [[https://www.rust-lang.org/][Rust]] and compiled to [[https://webassembly.org][WebAssembly]] so they can be used in a browser. Here's an example:\n\n[[./docs/maze-15-15-720910203442283167.svg]]\n\n** Status\n\nThe project is currently an MVP. It is hosted at https://aleks.bg/maze where you can tweak maze generation parameters. The web page provides a unique link to every generated maze[fn:1]. You can populate a PDF file with an arbitrary amount of mazes (one per page) and print them. The printed mazes have QR code backlinks to the site so you can check for a solution later.\n\nThere's a command line application that similarly accepts the maze's parameters and random seed and outputs an SVG file with the maze's parameters as its name.\n\nYou can use one of two algorithms to create the mazes:\n\n- \"Growing Tree\" (based on [[https://en.wikipedia.org/wiki/Vojt%C4%9Bch_Jarn%C3%ADk][Jarník's]], aka [[https://en.wikipedia.org/wiki/Prim%27s_algorithm][Prim's spanning tree algorithm]]) with a hard coded selection criterion that means the algorithm degenerates to a randomised depth-first search. Creates few, long, meandering passages\n- \"Kruskal's Algorithm\" (based on [[https://en.wikipedia.org/wiki/Kruskal's_algorithm][Kruskal's spanning tree algorithm]]). Creates mazes with lots of intersections and many short passages\n\n[fn:1] Note that the backlinks are not stable yet, and the maze you see when you follow a link may not be the one you printed as internals may change at any time.\n\nYou can also choose between different shapes of the overall maze: a square or a circle are available. The latter is also known as a θ-maze.\n\nCircular mazes  have an interesting property: their cell count grows: $2^{log_2(n)}$ where $n$ is the amount of rings. Compare square mazes that grow at $n^2$. In practice, the number of cells in a given θ-maze is\n\n$$1 + \\sum_{i=1}^{i \u003cn} c2^{\\lfloor\\log_2(i)\\rfloor}$$\n\nWhere $c$ is the /column factor/, i.e. the number of cells in ring 1. (It is currently hard-coded to 8.) This means that a maze of size 10 maze has 297 cells, one of size 20 1193. When switching between square and circle mazes in the UI, we therefore halve the number of cells. This makes intuitive sense, as each ring is like one line of cells in a square maze, but the rings count twice. So a comparable circle maze will always have half the \"size\". This means that it will have fewer cells, as the above function grows more slowly than $n^2$.\n\n** Building\n\nThe Rust project can be built using\n\n#+begin_src shell\n  cargo build --release\n#+end_src\n\n(You will need ~cargo~ and a Rust compiler.) To create the web page, you'll also need ~node~, ~bun~[fn:2], and ~wasm-bindgen~.\n\n#+begin_src shell\n  cd web/frontend\n  wasm-pack build --target bundler --release \u0026\u0026 bun run build\n#+end_src\n\nTo build it for a certain subdirectory of a page, use e.g. ~--base=/maze~ on the ~bun run build~ command.\n\n[fn:2] ~npm~ or comparable programs should work fine, too.\n\n** Desiderata\n*** A nicer UI\n\nThe current UI is bare-bones.\n\n*** An adjustable selection criterion for GrowingTree\n\nGrowingTree currently selects its next cell exclusively from the top of the stack. Were it to follow a certain random distribution, that could be made adjustable, which would allow for different maze topologies (choosing from further back will create more passages, intersections and dead ends).\n\n*** Offer different maze topologies\n\nBraid mazes as well as quasi-3D mazes with \"bridges\" and \"tunnels\".\n\n*** Offer different maze geometries\n\nCircular, elliptic, triangular and hexagonal mazes look neat and might be fun to implement. Mazes could probably be drawn along Penrose tilings and [[https://aatishb.com/patterncollider/?symmetry=19\u0026pattern=0.88\u0026rotate=180][similar irregular tilings]].\n\n** Bugs\n- [X] The last segment of the solution path of theta mazes (the extra one tacked on to the end so the path doesn't end in the middle of the cell) is an elliptical arc segment, but should be a line. It's a bit squiggly, visually.\n- [X] Sigma mazes are stained from the exit, instead of from the entrance, like all other mazes (so the exit is yellow, and the entrance can be in a medium peachy segment)\n- [X] Rectilinear mazes seem to just be stained from the origin. Why? Sample: =#R24|GrowingTree|4078526631170035261=\n- [ ] Sigma mazes are printed with a narrower width than other mazes. My guess is they're too tall to fit in the box, since sigma mazes are taller than they are wide.\n\n* License\n\nThis project is licensed under the [[https://www.gnu.org/licenses/gpl-3.0.html][GPLv3]]. Find [[https://www.gnu.org/licenses/quick-guide-gplv3.html][more information here]].\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadimit%2Famazegen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadimit%2Famazegen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadimit%2Famazegen/lists"}