Wave function collapse: Difference between revisions

m
→‎{{header|Wren}}: Minor changes to preamble.
(Added Wren)
m (→‎{{header|Wren}}: Minor changes to preamble.)
Line 266:
Well, I don't know whether this task is going to be deleted or not and, as I don't fully understand it anyway, I can't say I'm bothered either way.
 
However, as RDMRdm has obviously put a lot of effort into understanding it and has written a C version, I thought I'd have a go at translating it into Wren.
 
It's difficult with something like this where the results are random to know whether you've translated it correctly or not but one thing I did notice about the C version is that, in the final set of loops in the ''wfc'' function, the indexing is overflowing the allocated size of the ''tiled'' array (255256) getting up to 272. I don't know whether the intention was to wrap around (as ''tiled'' is a ''char*'') but, for now, I've simply ignored indices above 255 in the Wren version.
<lang ecmascript>import "random" for Random
 
9,482

edits