This is a simulation of a fractal in a square being formed. The sprite points towards a random corner or midpoint of an edge and places a point 2/3 of the space in between the sprite and the selected point. No idea how this works, but there are probably answers somewhere.
Optomized by @Trollmaster505 Here's a link if you want to run this on turbowarp: https://turbowarp.org/943303558 Check it out this idea running as a triangle instead (sierpinski triangle!) https://scratch.mit.edu/projects/943587795/