Wave function collapse: Difference between revisions
→{{header|J}}: fix the english definition of "tile" to fit how the code works
(J: bugfix) |
(→{{header|J}}: fix the english definition of "tile" to fit how the code works) |
||
Line 214:
}}</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 with a one pixel overlap with each of its adjacent neighbors. And
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.
|