https://github.com/corasaurus-hex/labyrinth
A maze generator in clojure
https://github.com/corasaurus-hex/labyrinth
Last synced: about 1 year ago
JSON representation
A maze generator in clojure
- Host: GitHub
- URL: https://github.com/corasaurus-hex/labyrinth
- Owner: corasaurus-hex
- License: epl-2.0
- Created: 2019-06-17T23:44:20.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2025-05-04T21:36:16.000Z (about 1 year ago)
- Last Synced: 2025-05-04T22:32:57.811Z (about 1 year ago)
- Language: Clojure
- Size: 49.8 KB
- Stars: 2
- Watchers: 0
- Forks: 2
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Labyrinth [](https://circleci.com/gh/corasaurus-hex/labyrinth)
A Clojure library designed to generate mazes.
## Usage
``` clojure
(require '[labyrinth.grid :as g]
'[labyrinth.grid.export.ir :as ir]
'[labyrinth.grid.binary-tree :as bt]
'[labyrinth.grid.export :as e])
(-> (g/->maze 10 10) ;; build an empty 10x10 cell maze
(bt/gen) ;; generate the maze using the binary-tree algorithm
(ir/->ir) ;; generate an intermediate representation of the maze for exporting
(e/ir->txt) ;; take the intermediate representation and convert it to txt
(println))
;; ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
;; ┃ ┃
;; ┃ ┏━━━━╸ ╻ ╻ ┏━━━━╸ ╻ ┏━━━━╸ ┃
;; ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃
;; ┗━━━━┻━━━━╸ ┣━━━━┛ ┣━━━━╸ ┃ ┃ ╻ ┃
;; ┃ ┃ ┃ ┃ ┃ ┃
;; ╻ ┏━━━━╸ ┣━━━━━━━━━┛ ┏━━━━┻━━━━┛ ┃ ┃
;; ┃ ┃ ┃ ┃ ┃ ┃
;; ┣━━━━┛ ┏━━━━┻━━━━╸ ╻ ┃ ╻ ┏━━━━┛ ┃
;; ┃ ┃ ┃ ┃ ┃ ┃ ┃
;; ┣━━━━━━━━━┛ ┏━━━━╸ ┣━━━━┛ ┣━━━━┻━━━━╸ ┃
;; ┃ ┃ ┃ ┃ ┃
;; ┣━━━━━━━━━━━━━━┻━━━━╸ ┣━━━━╸ ┃ ╻ ╻ ┃
;; ┃ ┃ ┃ ┃ ┃ ┃
;; ┣━━━━╸ ╻ ┏━━━━━━━━━┻━━━━╸ ┣━━━━┻━━━━┛ ┃
;; ┃ ┃ ┃ ┃ ┃
;; ┃ ┏━━━━┻━━━━┛ ┏━━━━╸ ╻ ┃ ┏━━━━╸ ┃
;; ┃ ┃ ┃ ┃ ┃ ┃ ┃
;; ┃ ┣━━━━╸ ┏━━━━┻━━━━╸ ┣━━━━┛ ┃ ╻ ┃
;; ┃ ┃ ┃ ┃ ┃ ┃ ┃
;; ┗━━━━┻━━━━╸ ┗━━━━━━━━━━━━━━┻━━━━━━━━━┻━━━━┻━━━━┛
```
## Development
### Dependencies
* [just](https://github.com/casey/just)
* [clojure](https://clojure.org/)
### Starting a REPL
``` shell
just repl
```
### Running Tests
``` shell
just test
```
### Building
``` shell
just ci
```
## License
Copyright © 2019 Cora Sutton
This program and the accompanying materials are made available under the
terms of the Eclipse Public License 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the Eclipse
Public License, v. 2.0 are satisfied: GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or (at your
option) any later version, with the GNU Classpath Exception which is available
at https://www.gnu.org/software/classpath/license.html.