Skip to content

maacl/wfclj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Wave Function Collapse in Clojure

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published