Wave function collapse: Difference between revisions

m
m (→‎{{header|J}}: grammar)
Line 216:
}}</lang>
 
We work with the 3x3 partial tiles, and the larger 17x17 tile which we are randomly generating. (17x17 because every 3x3 block contributes 2x2 pixels to the result and along a horizontal and vertical edge row and column of the tile, the 3x3 blocks contributescontribute an additional row and column of pixels.)
 
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