Skip to content

fl4shk/wfc

Repository files navigation

wfc

Wave Function Collapse in C++20

This requires the C++ version pcg_random. Also, make sure you recurse submodules when cloning.

Example:

$ ./wfc -i mountain_range.txt -w 32 -h 32 -d 3 -o
^^  &...&           ^^^  &&&&&..
^^^ &...&   ^^     ^^^      &&&&
 ^^ &..&&   ^^   ^^^^           
 ^^ &..&&        ^^^    ^^      
    &..&         ^^^    ^^^     
    &..&    ^^^  ^^^^    ^^     
 ^^ &..&    ^^^    ^^    ^^^  ^^
^^^ &..&    ^^^           ^^  ^^
^^  &..&         &&&&&&         
    &..&  &&&&&&&&&..&&&&&&&&&&&
&&&&&..&&&&&....................
................................
...............&&&&&........&&&&
&&&&&&&&&&&&&&&&&  &&.......&   
    &&              &.......&   
           ^^^^     &......&& ^^
&       ^^^^^^^  ^^ &......&& ^^
&       ^^^^     ^^ &.......&   
&  &&               &.......&   
&&&&&&&&&&&&&&      &......&&   
........&&..&&&&&&&&&......&&   
...........................&    
&&&&&......................&    
    &...&&&&&&&............&    
    &..&&     &............&    
^   &..&      &............&  &&
^^  &..&   ^^ &............&&&&&
^^  &..& ^^^^ &..&&&&...........
    &..& ^^^  &..&  &...........
&&&&&..&      &..&  &..&&&&&&&&&
&&.....&      &..&  &..&       &
.......&      &..&  &..&  ^^