Wave function collapse: Difference between revisions

m
Line 30:
}}</lang>
 
For this task, a "tile" represents a rectangular matrix of black or white pixels which is thought of a being potentially repeated arbitrarily in all directions. And, we work with two kinds of tiles: the 3x3 argument tiles, and the 16x16 larger tile which we are randomly generating. (Conceptually, of the argument tiles overlaps with its neighbors by one pixel, thus each argument tile only contributes a 2x2 pixel region to the result. (Perhaps we should make ana one pixel exception for two borders in the larger tile which we are assembling, -- creating a 17x17 tile -- but if it's actually a tile, regularity of structure in aits larger tiling space suggests that that would be a bad idea.))
 
Here, <code>m</code> is the list of tiles, and <code>i</code> represents an 8x8 list of indexes into that list (or, conceptually whatever dimensions were specified by <code>y</code>, the right argument to <code>wfc</code> -- but for this task <code>y</code> will always be <code>8 8</code>), with <code>_1</code> being a placeholder for the case where the index hasn't been choosen -- initially, we pick a random location in <code>i</code> and assign an arbitrarily picked tile to that location.
6,962

edits