A port of WaveFunctionCollapse by ExUtumno/mxgmn; takes a single sample of a grid to imitate and produces one or more
grids of requested sizes that have a similar layout of cells to the sample. Samples are given as
int[][]
where an int is usually an index into an array, list,
Arrangement
, or some similar
indexed collection of items (such as char values or colors) that would be used instead of an int directly. The
original WaveFunctionCollapse code,
here, used colors in
bitmap images, but this uses 2D int arrays that can stand as substitutes for colors or chars.
Created by Tommy Ettinger on 3/28/2018. Port of https://github.com/mxgmn/WaveFunctionCollapse