#[0.0.8-RC3][SPZ2-3568] Randomized Operator Goal algorithm code bug

7 messages ยท Page 1 of 1 (latest)

daring herald
#

As per algorithm screenshot in #๐ŸŽฐmake-anything-machine message and verified by @heavy yoke in #๐ŸŽฐmake-anything-machine message

Line 238 231 uses shape instead of stackedShape as the argument to Op_PushPin, meaning the random stackedShape from a few lines above is lost and replaced with a copy of the current shape so far plus pins.

Maybe also worth mentioning that pushing pins like this means the total height will increase by 2, but the code does not account for this, meaning it might end up creating and stacking more layers than max. Is that intentional or was the idea to just fill in pins or something else? It could certainly still make interesting shapes as currently written. But in either case I would suggest rewriting the for loop with a fixed iteration count into a while loop that checks the shape's current height.

Thanks for the fun game!

heavy yoke
#

*line 231 in the screenshot ๐Ÿ˜…

daring herald
#

Whoops! Fixing ๐Ÿ˜‡

waxen merlin
daring herald
#

No, if the height is checked at the start of the loop, the topmost generated layer could still get pins pushed, resulting in just the pins remaining after stacking like before

#

That said, this also matters in the other direction thanks to gravity: if you do 4 iterations, but rng makes each layer a single quadrant different from the others, the output is only one layer ๐Ÿ˜›

#

So it depends if the design goal is to actually reach a desired height or not