A pure Clojure implementation of the Wave Function Collapse algorithm invented by Maxim Gumin.
This implementation is inspired by the Python version referenced in this article.
(print-grid
(make-grid-and-run 20 20 input-matrix-1))
This will derive the weights and compatibilities from the tiles in input-matrix-1
, construct a 20 x 20 grid based on these, and run the algorithm on it.
The output to the terminal should be colored. Please note that the CIDER REPL will print some "�[42ml" chars due to chunking, please see this issue.
There is another Clojure version of the WFC alogrithm here but that "just" calls into a Java library.
Apache 2.0 Copyright © 2020 Martin Clausen
Reddit user u/deaddyfreddy for refactoring tips.