Exactly as I do as a human when I build such walls (several of them in my life). It’s a very difficult spatial problem to fit the stones into a pretty, stable structure. No doubt something large memories and detailed spatial search on a computer could help with. That doesn’t seem to have happened in this example, though. That wall is horrendously ugly.