Skip to content

Latest commit

 

History

History
28 lines (17 loc) · 1.07 KB

README.md

File metadata and controls

28 lines (17 loc) · 1.07 KB

wfclj

A pure Clojure implementation of the Wave Function Collapse algorithm invented by Maxim Gumin.

wfc

This implementation is inspired by the Python version referenced in this article.

Usage

(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.

License

Apache 2.0 Copyright © 2020 Martin Clausen

Thanks

Reddit user u/deaddyfreddy for refactoring tips.